-->
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.  [ 2 posts ] 
Author Message
 Post subject: querying many-to-many with descriptor on join table
PostPosted: Thu Nov 24, 2005 5:51 pm 
I have the following (existing non-modifiable) schema,


tblApplication
--------------
PK App_id
CreatedDate


Top
  
 
 Post subject:
PostPosted: Thu Nov 24, 2005 9:03 pm 
Senior
Senior

Joined: Thu Jun 02, 2005 5:03 pm
Posts: 135
Location: Paris
To clarify, is the issue that you want to effectively have a Party class with derived types (Builder and Broker), but the discriminator that defines which subclass of Party the given instance is does not exist in the same table as the Party objects themselves?

If the party type existed in the Party table I know you could construct your relationships (many to many, since you're using a join-table) easily enough and create the appropriate queries but I'm not certain whether or not you can actually have your discriminator in another table.

An example query might be:

Code:
FROM Party p INNER JOIN p.Applications a WHERE a.Id = ? AND p.class = ?


This would return all Party objects that have an application with the specified id and are of the specified class.

I know this isn't really answering your question, but I wasn't entirely clear as to what you're after from your post. :(

Symon.


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

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.