-->
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: Mix Inheritance Strategy in hierarchy... is this possible?
PostPosted: Mon Mar 17, 2008 2:19 pm 
Newbie

Joined: Mon Mar 17, 2008 1:55 pm
Posts: 3
I am trying the following hierarchy and I can get it to work when I run select's however, when I try to insert data, it fails with a Contraint Violation Exception. If I add a BaseContactVO it persists fine, but if I create a new ContactVO then it seems to want to add it twice to the same table and thus it creates a duplicate ID.... I was under the impression that this was possible, but maybe I am mistaken.

@Entity
@Inheritance(strategy = InheritanceType.JOINED)
@Table(name = "rootobjects", catalog = "demo")
public abstract class RootObjectVO {

@Entity
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@Table(name = "contacts", catalog = "demo")
public class BaseContactVO extends RootObjectVO {

@Entity
@Table(name = "contacts", catalog = "demo")
public class ContactVO extends BaseContactVO {

Has anyone else succeeded at something like this?

Thanks for the help,

Kevin


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.