-->
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.  [ 4 posts ] 
Author Message
 Post subject: How to map join-tabel columns to many-to-many ends....
PostPosted: Thu Mar 18, 2004 2:39 am 
Newbie

Joined: Thu Feb 26, 2004 10:05 pm
Posts: 15
Hi all,

I understand that you can use <composite-element> to map table's column from the join-table to either ends of the many-to-many relationship. But approach will only give either end entity a one-to-many relationship to the components that contains data collected from the join-tables. What I really want is to have properties of one ends of the many-to-many relationship, to be automatically load from the join-table given the opposite end of the relationship. For example,

A(x,y,z)*<-->*B => A<-*AB(x,y,z)*->B

so if 'a' is an instant of A, and 'b' is an instant of B. And a<-->b are links, i.e. associated, then I want a's properties to be automatically loaded

e.g. A.x==AB.x; A.y==AB.y; A.z==AB.z given instant of A and B are associated.

A real world implication is, having a Code entity that has many-to-many relationship with Dictionary entity. Code has id and image properties, where image is being store in the join-table. So if instance of Code is assinged with an instance of Dictionary, then automatically the image property of Code will be load from the associated row and column that reflex the instance of Code and Dictionary association, i.e. or assignment.

Thanks in advance for any help or ideas,

--danny


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 19, 2004 6:27 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
use unmapped getter/setter doing the job

_________________
Emmanuel


Top
 Profile  
 
 Post subject: unmapped accessor?....
PostPosted: Fri Mar 19, 2004 12:48 pm 
Newbie

Joined: Thu Feb 26, 2004 10:05 pm
Posts: 15
Hi,

Can you give further explaination, or any example?

Thanks,

--danny


Top
 Profile  
 
 Post subject: will this works
PostPosted: Fri Mar 19, 2004 1:06 pm 
Newbie

Joined: Thu Feb 26, 2004 10:05 pm
Posts: 15
Hi,

What do you mean by unmapped getter/setter? can you give further explaination, or some sample codes? Right now, I am thinking creating a one-to-one relationshipt between Dictionary and Code to associate code to a DEFAULT Dictionary, and buy having Code implement the onLoad method of the LifeCycle interface to navigate the list of the mapped composite-element(s) to its many-to-one association with Dictionary end, and compare this Dictionay instant against the one-to-one instant of the Dictionary, if they are match then the associated composite-element properties will be use to load the Code's unmapped getter/setter. But this seem to be quite some work to scan the entire Dictionary, and so I wonder if there is any other way to do the job better and faster?

Thanks,

--danny


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.