Hibernate session.get () UUID String Identifier Problem

I have a problem with Hibernate.

The primary identifier key in the mysql table is a UUID style string. eg08fe2a75-5d40-4645-896d-aab2a3ac96b8

But I can not use session.get()to retrieve data for some reason.

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

This seems like normal with integer identifiers.

Please inform

+3
source share
1 answer

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

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

Or, configure the following category for debugging in the logging backend configuration.

org.hibernate.SQL

( SQL-).

+1

Source: https://habr.com/ru/post/1762474/


All Articles