May 24, 2005
Hibernate Support

I take it all back. Hibernate support isn't as great as all that after all. After a very good start, I've had no help whatsoever on several issues. One I managed to work out for myself - One-to-many relations with composite natural keys.

I'm still having problems with a couple of issues, though. Firstly, I can't work out how to do data cleansing with Hibernate. It falls over on the first dodgy data it sees. I want to get a list of all the problematic data, and I can't work out how to do it.

The other problem that I'm having or with a complex relationship between a couple of entities; both one to many and one to one. I've got company definitions and currency definitions with a bog standard parent-child relationship - one company has a number of currencies defined for it. But the company also has a reporting currency - a foreign key back to the currency file. I can see that this relationship is slightly problematical in relational terms, but it makes perfect sense in business terms. Anyone have any idea how to write this relationship in Hibernate? (In fact, I can think of two workarounds. I could make the reporting currency code available as a property rather than relating back to the current table directly. Retrieving the currency object would then be the client code's job. Or, perhaps I could try building the company to currency link as a one to many. I'm not even sure that that would work. Besides, I really want to fix this problem properly, for one and for all. I'll probably come across a lot of this kind of relationship as I map more of my legacy database.)

I wonder if the problem is that Hibernate uses a forum rather than a mailing list? It's much easier to ignore forum threads that it is to ignore emails in your inbox.

Whatever the issue, I do know that questions like mine do get some kind of answer on, Just about any inquiry gets some kind of response, even if it's just a request for more info, or a URL to follow up.

Posted to Java by Simon Brunning at May 24, 2005 10:01 AM
Post a comment

Email Address:



Remember info?