-->
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: Attributes of parent class are not getting mapped
PostPosted: Thu Aug 11, 2005 12:40 am 
Newbie

Joined: Tue Aug 09, 2005 3:03 pm
Posts: 14
Is there a good example of using @EmbeddableSuperclass tag with an abstract parent class?

I have abstract class AItem and subclass ItemHSQL that extends it. My problem is that the attributes in the parent class are not getting mapped to the table fields my subclass.

Here is the code:


Code:
@EmbeddableSuperclass(access=AccessType.FIELD)
@Table(name="Item")
public abstract class AItem implements IItem{
   @Id
   int id;
   @Column(name="name")
   String name;

   public abstract int getId();
   public abstract void setId(int id);
   public String getName() {
      return name;
   }
   public void setName(String name) {
      this.name = name;
   }
}

   
@Entity
@Table(name = "ITEM")
@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
public class ItemHSQL extends AItem implements Serializable
{
   final String  CLASS_NAME="ItemHSQL";

   public ItemHSQL(){};
   public ItemHSQL(String name, double value)
   {
      this.name=name;
      this.value = value;
   }

   @Id(generate = GeneratorType.AUTO)
   public int getId ()
   {
      return id;
   }

}   


Any suggestions?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 11, 2005 5:24 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Already answered in JBoss forum

_________________
Emmanuel


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.