-->
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: Inheritance strategy without discriminator (for read/write)
PostPosted: Mon May 09, 2011 11:06 pm 
Newbie

Joined: Mon May 09, 2011 10:47 pm
Posts: 2
Hi,

I’m wondering if it's possible to configure subclasses without any discriminator? When you use SINGLE_CLASS inheritance strategy you must specify a discriminator column/value. By default is will populate the column as DTYPE which results in the following error:
ORA-00904: "DTYPE": invalid identifier

I have an entity which extends from another base entity. The parent entity has all the persistence annotations. The child class is used only for creating new records since I have some additional business logic around how the object can be created. I know I can modify this to have my child simply wrap the parent instead, decorator pattern, but I was wondering if it was possible through inheritance?

So for instance, I want to be able to do the following:

@Entity
@Table(name="MY_BASE_OBJECTS")
public class BaseObject
{
@Column(...)
...
}

@Entity
public class CreatableObject
extends BaseObject
{
...
}

Any help would be greatly appreciated!
Thanks.


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.