-->
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.  [ 4 posts ] 
Author Message
 Post subject: Java Interfaces....
PostPosted: Mon Apr 19, 2004 4:18 pm 
Newbie

Joined: Thu Apr 01, 2004 2:19 pm
Posts: 14
I have a 2 classes which implement a common interface.

Class A implements MyInterface {
}

Class B implements MyInterface {
}

How can I use the same XML configuration file for DB operations on both classes, or can the XML file refer to the interface?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 19, 2004 4:21 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Just map the interface with the two classes as subclasses. Look at http://www.hibernate.org/hib_docs/reference/html/inheritance.html


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 20, 2004 9:15 am 
Newbie

Joined: Fri Apr 16, 2004 9:27 am
Posts: 18
Location: Russia, Spb
michael wrote:
Just map the interface with the two classes as subclasses. Look at http://www.hibernate.org/hib_docs/reference/html/inheritance.html


But if I want generate class that have to implement some interface (without mapping). Generated code must contain
Code:
implements IMyInterface
code only.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 20, 2004 9:32 am 
Newbie

Joined: Fri Apr 16, 2004 9:27 am
Posts: 18
Location: Russia, Spb
And sometimes I need to inherit from abstract class as parent class with default implemented logic (instead interface).


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.