3

I am having a problem with Hibernate.

The primary key of ID in mysql table is UUID style String. e.g.08fe2a75-5d40-4645-896d-aab2a3ac96b8

But I can not use session.get() to fetch out the data for some reason.

Software software=(Software)session.get(Software.class, id);

It seems ok with integer IDs.

Please advise

1
  • What's the error that you see? Commented Aug 31, 2010 at 15:03

1 Answer 1

1

Activate the logging of the generated SQL to see what is happening exactly. This can be done by setting the following property in your Hibernate configuration:

<property name="hibernate.show_sql" value="true"/>

Or set the following category to debug in the configuration of your logging backend.

org.hibernate.SQL

Compare the generated query with the expected result (that works in your SQL client).

Reference

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.