我正在尝试使用jpa2特性@ElementCollection来获取实体中的String列表。我正在使用Hibernate3-maven插件来执行hbm2ddl任务。
但是,插件使用的hibernate工具的版本似乎不知道如何处理@ElementCollection注释,任何人都可以给我指点我需要使用的hibernate工具的哪个版本,这样就不是这样了。应该只是指定hibernate工具的正确版本吗?
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>hibernate3-maven-plugin</artifactId>
<version>2.2</version>
<dependencies>
<dependency>
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>8.3-603.jdbc4</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-tools</artifactId>
<version>3.2.4.GA</version>
<type>jar</type>
<scope>runtime</scope>
</dependency>
信息跟踪org.hibernate.MappingException:无法确定用于: java.util.List的类型,在表处: mystuff,用于列:org.hibernate.mapping.Column(内容)
谢谢
发布于 2010-11-15 15:31:33
我认为你只是有一个版本与插件不匹配。Hibernate3-maven插件依赖Hibernate 3.3.1.GA。
您可以在hibernate3-maven-plugin上尝试忽略这一点,并手动获得正确的版本(3.5.3最终可能有效)。
也许在字段上设置注释而不是setter可能也有帮助。
https://stackoverflow.com/questions/4185809
复制相似问题