How to define UserType username globally in Hibernate?

You can use the @TypeDefs annotation to define a short type name for UserType. But how to define it for the whole application?

+3
source share
1 answer

You can specify a base value type name (see http://docs.jboss.org/hibernate/core/3.6/reference/en-US/html_single/#mapping-types-basictypes ) in your UserType class, making this class a replacement standard class.

For instance:

<typedef name="string" 
      class="com.foo.hibernate.userType.NewStringUserType"></typedef>
+1
source

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


All Articles