且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

JPA映射到Oracle用户定义的类型

更新时间:2023-09-11 21:27:16

你不能用直接的JPA来完成。它没有用户定义类型的概念。为此,您必须使用供应商扩展。


Oracle allows for the definition of user defined types. Hibernate can map to these types using the org.hibernate.usertype.UserType class. This defines a mapping between a java bean and the Oracle type.

Using straight JPA, how would one do the same thing?

You cannot do it with straight JPA. It doesn't have concept of user defined type. For this need you have to use vendor extensions.