nordborg wrote:
It seems like they are planning something at least with loading an item by natural key for Hibernate 3.6
That's interesting.
Yet, it seems that this would just give <natural-id...> more or less the same functionnalities of <id...>. I am not sure this would allow for the use of the two at the same time!
Actually, I'd like to keep my good old surrogate <id...>, while having a better control on how the save-update process works. I'd like to say to Hibernate: your decision to
insert or
update a record not only depends on the value of the <id> key, but also on the value of another property (which could be a natural-id key, or just a "unique" property).
nordborg wrote:
If you have a DAO you could for example have a method getBByCode(String code) that takes care of everything.
Yes, that's what I ended up doing! :-)
I'm going to have a look at the current JIRA issues, and see if it's worth posting a new improvement request for that.
Thanks for your answer anyway.