Hi all,
I'm terribly sorry for posting this having only read the reference manual and a few posts from the forum. I've just convinced my people to use hibernate and this is (I think) a very complex mapping. The problem is as follows.
Tables:
EndPoint
ServiceType
Service
id
endPoint_id
serviceType_id
ServiceType1DataVersion
ServiceType2DataVersion
service_id
version
... (more data versions)
ServiceCommand
id
service_id
serviceDataVersion_version (not a key since it maps to multiple tables: ServiceType1DataVersion.version, ServiceType2DataVersion.version, etc. Also, it may be a version previous to the last entry in the version table for a given Service--think state rollback)
Classes:
Service
ServiceType1 extends/implements Service
ServiceType2 extends/implements Service
ServiceCommand
ServiceType1InsertCommand extends/implements ServiceCommand
... (more commands)
Each service data is determined by the last command (note that it points to the dataVersion table)
So, to get a service and its current data, I first need to get the last ServiceCommand. Then, using the service_id, determine the service type, and finally get the data from the appropriate table using the service_id and serviceDataVersion_version that I got from the ServiceCommand... :)
Is there a simple way to map #1? Is it even possible? Performance-wise, how will it behave?
Thank you for your time, any help would be tremendously appreciated. :)
Cheers,
David