-->
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: Annoatation, implement interface
PostPosted: Thu Dec 15, 2005 7:38 am 
Newbie

Joined: Thu Dec 15, 2005 7:10 am
Posts: 1
Hello,

After browsing the forum and googling for few hours, I didn't find any help about using interface with Hibernate and annotation.
I use Hibernate3.1-rc2, hibernate-annotations-3.1beta6 and postgresql-8.0-314.jdbc3

I try this small exemple before starting a bigger project :

Code:
@Entity
@Inheritance(
      strategy=InheritanceType.TABLE_PER_CLASS
)
public interface Animals {
   @Id(generate= GeneratorType.AUTO)
   
   public long getEmail();
   public void setEmail(long tt);
   
   public long getLongeur();
   public void setLongeur(long tt);   
}


Code:
@Entity
@Entity
@Inheritance(
      discriminatorValue="Dog")
public class Dog implements Animals{ //implements Serializable{

   private long email;
   private long longeur;
   
   public long getEmail() {
      return email;
   }
   public void setEmail(long email) {
      this.email = email;
   }
   
   
   public long getLongeur() {
      return longeur;
   }
   
   public void setLongeur(long longeur) {
      this.longeur = longeur;
   }
}


I believe it's not the right syntax for interface inheritance.

Is there some one who already use annotation with interface.

Thanks


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.