-->
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: Is there any MappedSuperClass like annotation for interface
PostPosted: Wed Jul 19, 2006 8:13 am 
Newbie

Joined: Wed Jul 19, 2006 8:02 am
Posts: 2
Hi,
I was wondering if there is any MappedSuperClass like annotation that I can use on the Interface instead of a concrete/abstract class.
I was getting a NPE in jboss when I use the @MappedSuperClass annotation on interface.
I wantted to know how can I use Interface to be used as a mapped marker for my entities.
TIA,
HHH.


Top
 Profile  
 
 Post subject: Issues MappedSuperClass if not supported on Interface
PostPosted: Thu Jul 20, 2006 10:30 am 
Newbie

Joined: Wed Jul 19, 2006 8:02 am
Posts: 2
I see that the MappedSuperClass annotations just for Classes not for interfaces.
If this is the case then I cannot have my Associations to work with my interfaces.

For example


Code:


public Interface Address{}

public Interface Person{

public Address getAddress();
public void setAddress(Address address);

}

public Interface Employee extends Person{
}



@MappedSuperClass
public Class PersomImpl implements Person{
//For a association here I am forced to use AddressImpl
// instead of Address

}

@Entity
public class AddressImpl implements Address{
}


@Entity
public Class Employee extends PersonImpl implements Employee{

}



I am missing any thing or this feature is not really provided by Hibernate.

Can any one suggest me a better way to implement this with Hibernate.

TIA
HHH


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.