-->
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: Dynamic Entity with Annotations
PostPosted: Wed Apr 14, 2010 4:51 pm 
Newbie

Joined: Wed Apr 14, 2010 4:33 pm
Posts: 8
Hi I am still really new to Hibernate and I was trying to follow the test set at org.hibernate.test.dynamicentity.tuplizer2 for my class. I have an interface like:
Code:
public interface User extends Persistent //Persistent is just setId(), getId()
{
   void setUserName(String name);
   void getUserName();
.....
}


with an implementation of adminUser

Code:
@Entity
@DiscriminatorValue(value="user")
@Table(name="TBLUSER") //tblUsers
public class RAPIDUser implements User
{
    .....

    @Override
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name="id", updatable=false, nullable = false)
    public Long getId()
    {
    }

    public void setId(Long id)
    {
       this.id=id;
    }
........
}


currently I am getting a Hibernate Mapping Exception because right now I am trying to persist my interface but really I need to persist my subclass. Would it be better to move my persistance code over to the interface and just make the subclass mapped class? Basically I am confusing myself in how to map my interface implementation classes with annotations.
Thank you


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.