JPA和Oracle 12中的@Lob批注

时间:2018-07-19 17:16:00

标签: java oracle osgi eclipselink

我在我的项目中使用eclipse链接2.5.2。我的问题是以下,我有一个注释如下的属性:

@Basic()
@Column(name = "myName")
@Lob
private String myName = null;

但是自动生成的数据库表(在oracle 12中)的长度为4000个字符。

我已经在Internet上阅读过,问题似乎是JPA无法将数据库识别为oracle,因此我尝试使用:

但它引发以下异常:

Exception Description: Database platform class [org.eclipse.persistence.platform.database.oracle.Oracle11Platform] not found.
Internal Exception: Exception [EclipseLink-3007] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.ConversionException
Exception Description: The object [org.eclipse.persistence.platform.database.oracle.Oracle11Platform], of class [class java.lang.String], could not be converted to [class java.lang.Class].  Ensure that the class [class java.lang.Class] is
 on the CLASSPATH.  You may need to use alternate API passing in the appropriate class loader as required, or setting it on the default ConversionManager
Internal Exception: java.lang.ClassNotFoundException: org.eclipse.persistence.platform.database.oracle.Oracle11Platform
        at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:766)
        at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.getAbstractSession(EntityManagerFactoryDelegate.java:204)
        at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.createEntityManagerImpl(EntityManagerFactoryDelegate.java:304)
        at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:336)

我正在开发的应用程序是一个基于Equinox的OSGi应用程序。

我已经检查并定义了org.eclipse.persistence.platform.platbase.database.oracle.Oracle11Platform并将其捆绑包(“ org.eclipse.persistence.oracle”)定义为org.eclipse.persistence.core捆绑包的一部分

感谢任何提示。

0 个答案:

没有答案