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?

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?

Thanks!
Mario

Reply via email to