-->
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: Values not getting persisted
PostPosted: Fri Oct 16, 2009 9:04 am 
Newbie

Joined: Fri Oct 16, 2009 6:03 am
Posts: 2
Hi,
I have a class MyUser which extends the User class. There are two columns in MyUser class which are not populated when i persist the entity.

User class

Code:
@Entity
@Table(name="TBL_USERS")
@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(
    name="CLASS",
    discriminatorType=DiscriminatorType.STRING
)
@DiscriminatorValue("User")
public class User extends BaseObject implements Comparable<User> {
   
   private static final long serialVersionUID = 1013602284129249520L;
   public static final String FLAG_ACTIVE = "Y";
   public static final String FLAG_INACTIVE = "N";
   
   private long id;
   private String password;
   private String name;
.....
...


MyUser class

Code:
@Entity
@DiscriminatorValue(value="VolunteerUser")
public class VolunteersUser extends User {
    private static final long serialVersionUID = 4805522435037583872L;
   
    @Column(name="FIRST_NAME")
    private String firstName;
   
    @Column(name="SURNAME")
    private String surname;
    ....
    .....


Top
 Profile  
 
 Post subject: Re: Values not getting persisted
PostPosted: Thu Oct 29, 2009 8:11 am 
Newbie

Joined: Fri Oct 16, 2009 6:03 am
Posts: 2
Well i found the problem. Actually it was coz i also had the hbm file which didn't have the extra columns defined. Somehow hibernate was not complaining and was giving preference to the hbm file.


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.