Hibernate version:3.0.2
I am trying to figure out how manage the mapping for this pattern. The general scenario is this:
|-------------| |--------------|
| Event |----------| Note |
|-------------| |--------------|
I have a one-to-one logical relationship between Event and Note. Note is basically a free form text field in the application of no specific constrained size.
However, because our database is indirectly replicated to a legacy platform, the instances of Note actually needs to be stored as n instances of text, 70 characters long, so the physical relationship is really a one-to-many.
I am trying to figure how I can "hide" the multiplexing of the text field out into instances of NoteFragment and maintain the facade of Event and Note.
I successfully achieved it through non-mapped pojo operations which simply do the Multiplexing/Demultiplexing behind the scenes, but then the excellent session.getSession(EntityMode.DOM4J) XML data streaming does not see the text field properly.
Can anyone recommend a mapping strategy for this ? I have started looking at UserType and its derivatives, but I am not sure if these will do the job.
Thanks.
//Nicholas
|