-->
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: Best way to modelize a DB schema
PostPosted: Tue May 11, 2004 5:29 am 
Senior
Senior

Joined: Fri Nov 21, 2003 5:55 am
Posts: 155
Hello all,

I need your help and your opinion about my architecture schema.
I use Hibernate 2.1.2, JBoss 3.2.3 and JDK 1.4.2 with EJB and Struts.
I use Middlegen and Hbm2java to generate my mappinf files and my POJO.

But my problem is how to represent the association between 2 tables.
For example, I have one table A and one B and another C who is only composed by the foreygn key of A and B and another field for example a date.
For my other tables only composed by foreign keys I use a many to many reprensetation mapping and all works fine.
But the the specific case with some fields in the association table I use 2 links many to one like this :

<set name="languageCandidateValueObjects"
lazy="true"
cascade="all"
inverse="true"
>
<key>
<column name="CAN_SEQID" />
</key>
<one-to-many class="com.mcstechnology.mcsrecrutement.valueobject.LanguageCandidateValueObject"/>
</set>

LanguageCandidate is the representation of my table C, I use a composite-id for this.

The delete works well with the flag insert =true and I thing for the update to.
But if i try to insert a new row, Hibernate generates a new row for A but for C it tries to update the table and the foreign constraint is violated.

I try some possibilities and it's always the same thing. Insert and then update.

Thanks in advance for your responses and if you need more detail I can give you.


I want to know your opinion about my model if it's good or not


Top
 Profile  
 
 Post subject: Help
PostPosted: Tue May 11, 2004 6:33 am 
Senior
Senior

Joined: Fri Nov 21, 2003 5:55 am
Posts: 155
Anybody can help me about it?


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.