-->
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: Fields inheritance (custom types) for inherited classes ?
PostPosted: Mon Sep 13, 2010 6:19 am 
Newbie

Joined: Mon Sep 13, 2010 6:04 am
Posts: 1
Hi,

I have two classess, A and B, where A extends B. I use single-table inheritance with discriminator values, and it generally works OK. Now, in both classes I use custom-type fields which map to the same db column as Oracle's XMLType (via JiBX mapping - but it doesn't matter)... The thing is having the same column declared in both A and B.

So:
class A has field "AXml xml;"
class B has field "BXml xml;"

additionally, to have this configuration working in Java, BXml must extend AXml. Without it, compilation error occurs, which is quite understandable.

I try to add these fields mappings to A.hbm.xml and B.hbm.xml, but it doesn't work... Hibernate says that both fields access the same database column. Of course using other columns - works, but that's not what I need.

It would be nice to have this inheritance working. I know it's a rare situation, but a good-looking one from OO point of view, when using custom types. Is there any way to achieve it? Or should I register CR?

Greets,
Adam


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.