-->
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: annotation: patch for bind* for comp-id assoc and fetchmode
PostPosted: Tue Mar 22, 2005 7:49 am 
Regular
Regular

Joined: Thu Dec 11, 2003 4:14 pm
Posts: 86
Location: Hibernate 3 + annotations, Oracle 9i, PostgreSQL 8.0, Java 1.5.0
Before I submit a patch (if needet) some little discussion please.

I made the @ManyToOne working for me after I changed in function "bindManyToOne"

Code:
Property prop = makeProperty(propertyName, value, true, true, false, cascadeStrategy, propertyAccessorName);


to

Code:
Property prop = makeProperty(propertyName, value, columns[0].isInsertable(), columns[0].isUpdatable(), fetchMode == FetchMode.SELECT, cascadeStrategy, propertyAccessorName);


The insertable and updateable stuff was needet to allow the columns also be defined in an composite-key.
The fetchmode to allow me to use the fetch= argument in ManyToOne.

Discussion:
The insertable updateable flag is retrieved from the first column. This might be a little hacky, but the JoinColumns do not have such a attribute and so I decided to solve it that way.
Do one know a cleaner way or is it good enough for you?

I thought the fetchmode should be lazy by default, but the "false" in makeProperty make the association NOT lazy.
However my change will honor what the user configured.
Or do I miss something here?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 25, 2005 12:57 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Hi,
can you copy/pastle this post into the hibernate devel mailing list. I'll be easier fro me to follow it.

_________________
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.