-->
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.  [ 2 posts ] 
Author Message
 Post subject: Generated link table contains non nullable ids
PostPosted: Mon May 08, 2006 12:50 pm 
Newbie

Joined: Mon May 08, 2006 12:31 pm
Posts: 1
I have an entity A containing two lists (@OneToMany) relations to two different entity types B3 and B23, but both of these entity types are derived from the same persistable entity type Bp1. So both entity types arrive in the same table for Bp1.

When automatically generating the tables (the persistence.xml property 'hibernate.hbm2ddl.auto' is set to 'create-drop').

It seems it creates a link table containing 3 columns with 'A_ID', 'B3_ID' and 'B23_ID'.

Persisting always fails:

One entry in the table contains always an entry in column A_ID, but in the other columns there is always only one filled in (should). But any insert always fails, because there is always one of the columns null, but the table definition does not allow nulls; (it contains a link either to entity of type B3 or to entity of type B23).

I suppose I hit a bug ?

Hibernate 3.2CR1 with the latests annotations and entity manager. Using a Derby database.

I will submit a bug in Jira if there is nobody who can give a correct explanation about this (just posting here because it is really asked on the site).


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 25, 2006 3:47 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
this is not a bug explicit the jointable to be different across your associations

_________________
Emmanuel


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

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.