This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I keep getting the persistenceException : Could not determine type for: java.util.Collection, for columns : [org.hibernate.mapping.Column(NICKNAME)].
I use field access strategy for all my other attributes within the same entity. (I used different relationships in this entity. Such as @ManyToOne, @OneToOne, and so on. They all work fine if the above fragment is omitted)
It's been a while since I have worked with JPA so I can't say for sure what's wrong with the code you posted. A quick google search suggests that this might be a bug in Hibernate (http://blog.m1key.me/2010/06/orghibernatemappingexception-could-not.html). Are you using Hibernate as your JPA provider? If yes, then the solution seems to be to upgrade to 3.5.3-Final or later.
I ran your sample code as mentioned below. It worked fine. Please post your whole code and also as mentioned above, please do post your JPA provider name and version
Output is - I get 2 tables created successfully - Employee and Employee_Nicknames
I am using Hibernate as JPA provider and MySQL as database.
21:59:20,502 INFO SettingsFactory:126 - Database ->
name : MySQL
version : 5.5.28
major : 5
minor : 5
21:59:20,502 INFO SettingsFactory:132 - Driver ->
name : MySQL Connector Java
version : mysql-connector-java-5.1.28 ( Revision: email@example.com )
major : 5
minor : 1
Hibernate version is 3.6.10
Oracle certified Java 8 Programmer I (1Z0-808), Oracle Java Web Service Developer (1z0-897), Oracle certified Java 7 Programmer, SCJA 1.0, SCJP 5.0, SCWCD 5.0, Oracle SQL Fundamentals I, CIW Certified Ecommerce specialist