Here is the issue.
I have classes A and B, each of which hold a reference to an object of class C. There is nothing in common between A & B other than the fact that they both contain a C.
I would like to have C @IndexEmbedded (OneToOne) in both A & B.... And this works fine as long as I want to manually update the indexes when C changes, but I would prefer to avoid that.
I only really need these one way associations in my domain, but it appears I need the inverse OneToMany association annotated with @ContainedIn to enable HS to handle the automatic index update. Is my only option to alter the data model and inject a superclass to hold the association to C and then have A and B extend it (thereby providing a superclass to reference in the inverse association)? If so, does that require using a table per class inheritance approach or can I get by with a @MappedSuperclass? This seems like it would be a common problem but I haven't found any documentation referencing it. Any thoughts would be appreciated.
Thanks, Keith
|