You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mrumpf edited this page Jun 18, 2012
·
2 revisions
The SimpleTypesGenerator can on demand generate HibernateUser Type for usage with Hibernate Mappings. For all types except the ValueObject.
The UserTypes have the following characteristics:
The types implement the UserType interface as required by Hibernate
The generated class name is the name of the enum class with UserType appended.
Can be used as type in the property definition in the HBM file. Please note that you need to define the UserType as type to get a mapping to the associated generated type. For this to work buth classes must be available compiled on the classpath whenever the hbm is read.
Sometimes it is to get the UserType as Type to fullfill the Hibernate API eg. in SQLQuery.addScalar(...). Therefor each UserType has a static method getType() that returns the Hibernate Type. A usage sample could be: query.addScalar("ACTOR_ID", UserIdUserType.getType());