My thoughts inline.
Mario Ivankovits wrote:
Hello Emmanuel!
Heres the copy from the forum:
Before I submit a patch (if needet) some little discussion please.
I made the @ManyToOne working for me after I changed in function "bindManyToOne"
Property prop = makeProperty(propertyName, value, true, true, false, cascadeStrategy, propertyAccessorName);
to
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?
This is not really clean, I put a //fixme to check all the columns and raise an exception if there is a mismatch.
I thought the fetchmode should be lazy by default, but the "false" in makeProperty make the association NOT lazy.
As I told you lazy in a property is different from lazy in a association. value.setFetchMode() should be enough.
However my change will honor what the user configured. Or do I miss something here?
Thanks! Mario
------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ hibernate-devel mailing list hibernate-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hibernate-devel