users@glassfish.java.net

OneToMany annotation target

From: <glassfish_at_javadesktop.org>
Date: Sat, 06 Oct 2007 02:33:09 PDT

Hi,
I've noticed that @OneToMany has the following definition, so can be used before fields as well as methods.
Target({METHOD, FIELD})

I'm getting this mapping exception when @OneToMany is just put before a field (named "member, of type List<Something>):
javax.persistence.PersistenceException: org.hibernate.MappingException: Could not determine type for: java.util.List, for columns: [org.hibernate.mapping.Column(members)]

There is no error when OneToMany is put before getMember() method.

I want to know if this is a requirement by the spec, or just hibernate shortcoming.

Thanks,
Mohsen.
[Message sent by forum member 'mohsen' (mohsen)]

http://forums.java.net/jive/thread.jspa?messageID=238767