In working out the kinks in switching over to Annotations and using hbm2dll, I came across the following error:
Code:
[hibernatetool] Problems in creating a Ejb3Configuration. Have you remembered to add it to the classpath ?
[hibernatetool] java.lang.reflect.InvocationTargetException
[hibernatetool] javax.persistence.PersistenceException: org.hibernate.MappingException: Could not determine type for: p2p.common.user.User, for columns: [org.hibernate.mapping.Column(userId)]
[hibernatetool] org.hibernate.MappingException: Could not determine type for: p2p.common.user.User, for columns: [org.hibernate.mapping.Column(userId)]
At first, this message seems to describe a problem with a column definition (or reference) named 'userId' within my User class. I do have a @JoinColumn annotation that attempts to name the key reference 'userId,' but that wasn't the problem.
To make a long story short, I found the problem in a different class that was not referenced by the error message. It looked like the following:
Code:
@Column(name="userId", nullable=false)
private User mUser ;
But should look like this:
Code:
@ManyToOne
@JoinColumn(name="userId", nullable=false)
private User mUser ;
So, my long winded request is as such.... I'd love to see a little more information for this type of error from the MappingException. Is it possible to have something like this instead?
Code:
[hibernatetool] org.hibernate.MappingException: Could not determine type for: p2p.common.user.User, for columns: [org.hibernate.mapping.Column(userId)] as referenced in class: p2p.common.user.UserAlias.
Noting the problem area would help with debugging.
If I need to post this request elsewhere, let me know.
Thanks as always.