-->
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.  [ 3 posts ] 
Author Message
 Post subject: Joined-Subclass: Howto save parent as subclass
PostPosted: Fri Nov 03, 2006 7:36 am 
Newbie

Joined: Mon May 15, 2006 10:30 am
Posts: 7
I have 2 classes mapped as joined subclass:

@Entity
@Inheritance(strategy=InheritanceType.JOINED)
class A{
@Id
@GeneratedValue
private Long id;
}

@Entity
@PrimaryKeyJoinColumn(name="id")
class B extends A{
}


I have created and saved object A, but now I would like to save the same object as B.

The only things that seem to work are:
1. copying all data to B, delete A and save B. (not very useful because it creates a new id)
2. using native sql to insert id from A into B

Is there a way to do this in a "normal hibernate" style?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 27, 2006 12:40 pm 
Newbie

Joined: Wed Nov 08, 2006 1:05 pm
Posts: 6
I have exactly the same problem...
Did you find the answer??


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 27, 2006 12:42 pm 
Newbie

Joined: Mon May 15, 2006 10:30 am
Posts: 7
nope...


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.