-->
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: Not persisting data more than 2 levels of hierarchy
PostPosted: Fri Jan 15, 2010 7:11 pm 
Newbie

Joined: Fri Jan 15, 2010 7:03 pm
Posts: 1
I have 3 levels of classes
a) @MappedSuperclass
public abstract class CmpntObject implements Comparable, Serializable
{
@Column(name = "enabled")
private Boolean enabled = Boolean.TRUE;
}

b)@Entity
@Table(name = "asmnt_item", schema = "public")
@DiscriminatorColumn(name = "question_type_enum", discriminatorType = DiscriminatorType.STRING)
public abstract class Item extends CmpntObject implements Comparable
{
@Column(name = "valid")
private Boolean valid = Boolean.TRUE;
other columns..
}

c) @Entity
@DiscriminatorValue(value = "1")
public class SpecificItem extends AbstractItem
{
}

and when i do the following:

SpecificItem specificItem = new SpecificItem ();
specificItem.setEnabled(false);
specificItem.setValid(false);
session.saveOrUpdate(specificItem);

it persists the valid field (1 level up in the hierarchy) correctly in the database, but does not persist the enabled field (2 levels up in the hierarchy).

Is it a Hibernate issue, wherein it would not persist fields more than 1 level up the hierarchy?


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.