-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: reveng.xml creates nullable/non-nullable annotation conflict
PostPosted: Wed Feb 07, 2007 7:17 pm 
Beginner
Beginner

Joined: Fri Jan 26, 2007 3:16 pm
Posts: 24
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.