-->
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: replacement for class="" attribute in Anotations
PostPosted: Thu Oct 20, 2005 5:32 am 
Newbie

Joined: Thu Oct 20, 2005 4:15 am
Posts: 8
Hibernate version: 3.1 beta6

The point is as follows:
I have an interface two interfaces IA and IB and implementing classes A and B.

let say
Code:
interface IA{
IB getB();
setB(IB ib);
}

and here comes
@Entity
class A implements IA{
@Id and such...

IB b;

IB getB(){
  return this.b;
}

void setB(IB b){
  this.b = b;
}
}


And obviosly there is an exception saying that there is no entity of type IB.
The question: How can i explicitly tell Hibernate to use B instead of IB (as far as B implements IB)?

In xml-mapping I use to write
Code:
    /**
     * @hibernate.many-to-one class="B" cascade="all" constrained="true"
     */
IB getB(){
  return this.b;
}

but how to make it using anotations??? I can't find any docs on this...


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 20, 2005 6:07 am 
Newbie

Joined: Fri Oct 14, 2005 11:40 am
Posts: 7
@ManyToOne(targetEntity = B.class)


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.