Hi, I use hibernate.reveng.xml to generate annotated POJOs.
This is a sample property that is generated:
Code:
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumns( {
@JoinColumn(name = "EDGE_ID", nullable = false, insertable = false, updatable = false),
@JoinColumn(name = "EDGE_FYSPKEY", insertable = false, updatable = false) })
public Edge getEdge() {
return this.edge;
}
It auto-detects this relationship from the foreign keys in the db. However, you can see that one is defined as nullable, and one is not. When I go to run, this exception is thrown:
Code:
javax.persistence.PersistenceException: org.hibernate.AnnotationException: Mixing nullable and non nullable columns in a property is not allowed: domain.LineEdgeedge
I can fix this by setting the
nullable=false property on the EDGE_FYSPKEY column in the annotation, but is there some way I can make it annotate this automatically?
Thx in advance,
Davis