-->
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: UserType vs PropertyAccessor vs EntityPersister?
PostPosted: Fri Dec 16, 2005 9:34 pm 
Newbie

Joined: Mon Sep 26, 2005 2:40 pm
Posts: 17
Location: Seattle
We're attempting to map a (legacy) database, with an interesting situation.
A table (ServiceInstance) is referred to by one of 58 service-specific tables (like SVC_Email, SVC_DSL, etc). We've decided to create a concrete subclass for each of those 58 tables, all inheriting from a common superclass.
A value in a column two tables away from ServiceInstance (via regular foreign key relations) defines which table actually has the reference.

We tried the Joined-Subclass approach, but this creates a 58-way outer join. Correct from a database point of view, but unwieldy given the 'extra knowledge' we have from that additional column.

What we want is a persister/loader or other "thing" that can understand that a value two tables away tells you which of the 58 tables the foreign key references, and load the correct value.

I'm not sure how to approach this, it seems like there are a number of ways I can go. Is this a UserType situation? Or a PropertyAccessor? Or a custom EntityPersister?

-Kevin

Hibernate version:
3.1


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.