-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Mapp. Hierarchy containing versioned data given by a command
PostPosted: Wed Jun 09, 2004 5:28 am 
Newbie

Joined: Fri May 14, 2004 1:33 pm
Posts: 4
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
    id
ServiceType
    id
    description
Service
    id
    endPoint_id
    serviceType_id
ServiceType1DataVersion
    service_id
    version
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.