-->
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: Joined subclass inheritance issues update against base table
PostPosted: Tue Jun 18, 2013 7:46 am 
Newbie

Joined: Mon Jun 17, 2013 4:50 pm
Posts: 2
I am using hibernate 3.5.1 to implement a basic inheritance setup like this:

@Entity
@Inheritance(InheritanceType.JOINED)
@Table("parent_table")
public class Parent
{
}

@Entity
@Table("child_table")
@PrimaryKeyJoinColumn(name="id")
public class Child extends Parent
{
}


I am using JPA criteria to retrieve entities of the child class. However, when these elements are fetched, an update is issued against parent_type for each entity fetched.

If I model this as the Child has a one to one field that is of type Parent, then I do not have this issue.

Any ideas on what would updates against the parent table at fetch time?


Top
 Profile  
 
 Post subject: Re: Joined subclass inheritance issues update against base table
PostPosted: Tue Jun 18, 2013 11:15 pm 
Newbie

Joined: Mon Jun 17, 2013 4:50 pm
Posts: 2
I figured out the issue... both the child and the parent classes had "created" and "updated" fields. Once I renamed the fields in the derived class, the problem went away


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.