-->
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: union-subclass - can I keep my base classes?
PostPosted: Fri Dec 15, 2006 1:01 pm 
Newbie

Joined: Thu Dec 14, 2006 12:23 pm
Posts: 6
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3.1.2
Orace 10G


Hello again! I'm still struggling with trying to implement a union while not using straight sql. I just discovered this union-subclass strategy of hibernate and I can't seem to find much info on them (or examples or good documentation on how to use it).

I have two tables that are not related in any way other than I need to provide functionality for the user to search both tables in one query. This was easily implemented in oracle using a sql statement.

My question is that I have two classes that are used throughout our application other than the piece that I need to implement. The tables have many interdependencies with other tables that I can't and don't want to break. Can I define an abstract class using only the fields that I need in the union-subclass without removing the parent classes and hbm files? How do I reference the relationships in the associated hbm files?

Here are the two tables in question:
Code:
listing table
----------------
listing_id
name
status
department
<other rows>

message_group table
---------------
group_number
group_name
<other rows>


What I need to do is keep the listingbean.java and .hbm and messageGroupBean.java and hbm but still combine the two into a new class (pageableEntity.hbm) that contains the above two tables.

Can someone shove me in the right direction to do this or am I chasing my tail and should implement this using native sql?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 18, 2006 11:16 am 
Newbie

Joined: Thu Dec 14, 2006 12:23 pm
Posts: 6
el bumpo


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.