开发者

Support for @ElementCollection in hibernate tools hbm2ddl

开发者 https://www.devze.com 2023-01-24 23:29 出处:网络
I am trying to use the jpa2 feature @ElementCollection for a List of Strings in my Entity. I am using the hibernate3-maven-plugin to carry out the hbm2ddl task.

I am trying to use the jpa2 feature @ElementCollection for a List of Strings in my Entity. I am using the hibernate3-maven-plugin to carry out the hbm2ddl task.

However it seems the version of hibernate tools used by the plugin does not know how to deal with the @ElementCollection annotation can anyone give me pointers about what version of hibernate tools I need to use so that this is not the case. Should it just be a case of specifying the correct version of hibernate tools?

 <plugin>
  <groupId>org.codehaus.mojo</groupId>
  <artifactId>hibernate3-maven-plugin</artifactId>
  <version&开发者_JS百科gt;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>

[INFO] Trace org.hibernate.MappingException: Could not determine type for: java.util.List, at table: mystuff, for columns: [org.hibernate.mapping.Column(stuffs)]

Thanks


I think you just have a version mismatch with the plugin. hibernate3-maven-plugin has a dependency on Hibernate 3.3.1.GA.

You could try and ignore that on the hibernate3-maven-plugin and get the correct version (3.5.3 Final might work) manually.

Maybe setting the annotation on the field instead of setter might help as well.

0

精彩评论

暂无评论...
验证码 换一张
取 消