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?