-->
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.  [ 3 posts ] 
Author Message
 Post subject: intersection table m:m relationship question
PostPosted: Tue Feb 17, 2004 7:51 pm 
Regular
Regular

Joined: Mon Nov 24, 2003 6:36 pm
Posts: 105
Just need some clarification here, so I don't think source is necessary.

Let's say i have a parent -child relationship, that are many to many in my object model. Typically, the database will use 3 tables to resolve this many-many relationship. I have effectively used hibernate so that I can make this happen, but I am wondering if it is possible for the "intersection" table to have additional fields that I can somehow update, without having an associated entity mapped class for them.

I am asking because our DB folks typically add fields for "last updated, creation date, updatesource, userid" to these intersection tables, which means I have to clutter my object model with the interim object.

I have considered using the interceptor class, but that seems more geared to setting fields on entity classes, which in this case, there is no such class.

Thanks
James


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 17, 2004 7:56 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
No it is not possible to update any database fields without mapping them somewhere.


Top
 Profile  
 
 Post subject: Re: intersection table m:m relationship question
PostPosted: Wed Feb 18, 2004 3:35 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
jlawmi wrote:
I am wondering if it is possible for the "intersection" table to have additional fields that I can somehow update, without having an associated entity mapped class for them.

No and it's a pity :(
But you can add a new unmapped getter to hide this ugly entity.

_________________
Emmanuel


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