-->
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: Class implementing multiple interfaces & assoc with inte
PostPosted: Mon Dec 26, 2005 7:50 am 
Newbie

Joined: Mon Dec 26, 2005 7:09 am
Posts: 1
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:3.0

Problem description
In our project we are planning to use Hibernate as an ORM tool. While deciding mapping strategies for the class associations we are facing issues in some places. These issues are mentioned below

Mapping a class which has two interfaces and one of the interfaces is associated with another class

We have class Q1 and Q2 inheriting from class P.
Class Z1 and Z2 inheriting from interface X.
There is a n:1 bidirectional association between P to X.
Also class Z1 implements another interface Y.

Ideally we would like to map X and Y as two interfaces of class Z1 and keep reference of X in the mapping of class P. But Hibernate does not allow doing that.

The solution to tackle this issue

Treat the above association as association between P and Z1 and P and Z2. So in the class P we need to put attributes of Z1 and Z2 instead of X. But if the number of subclasses of X is fairly large then immediate the structure of class P becomes complicated.

We are curious to know whether there are any more efficient ways to implement the scenario mentioned above using Hibernate.


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.