-->
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: Problem many-to-many mapping
PostPosted: Wed Mar 19, 2008 8:30 pm 
Newbie

Joined: Wed Mar 19, 2008 7:46 pm
Posts: 1
Hi I'm in a trouble since one week.
I have 3 tables, one of them is called:
USUARIO(id_usuario, nombre)
another is called
EXAMEN(id_examen, descripcion)
and the last one is
USUARIO_EXAMEN(id_usuario_examen, id_usuario, id_examen, calificacion)


So, this is a problem where many-to-many mappings plays. I've seen examples almost the same, BUT is it possible to have an independent primary id (not a compound key "id_usuario, id_examen")? How would be the mapping in the xml file. Do I need another java file (for example UsuarioExamen.java) because I need to put some other fields in the table USUARIO_EXAMEN?

Thanks hope you can help me


Top
 Profile  
 
 Post subject: Re: Problem many-to-many mapping
PostPosted: Wed Mar 19, 2008 8:32 pm 
Expert
Expert

Joined: Wed Apr 11, 2007 11:39 am
Posts: 735
Location: Montreal, QC
broly27 wrote:
Do I need another java file (for example UsuarioExamen.java) because I need to put some other fields in the table USUARIO_EXAMEN?



Yes you do. The relation has data and in these cases you need to define relation as an entity.



Farzad-


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.