-->
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: Multiple joined-subclass mappings to same table
PostPosted: Sun Feb 08, 2015 2:21 pm 
Newbie

Joined: Sun Feb 08, 2015 2:09 pm
Posts: 1
Hi,

I am bit puzzled with this. I am looking at a codebase, where there are multiple joined-subclass mappings (in separate hbm.xml files) which map to same table. For union-subclass, we correctly get exception for duplicate mapping. But for joined-subclass it allows multiple mappings to same table. For Joined subclass, the table mapping is added with following method call.

Table mytable = mappings.addTable(
schema,
catalog,
getClassTableName( joinedSubclass, node, schema, catalog, null, mappings ),
getSubselect( node ),
false

For union-subclass, the mapping gets added with

Table mytable = mappings.addDenormalizedTable(
schema,
catalog,
getClassTableName(unionSubclass, node, schema, catalog, denormalizedSuperTable, mappings ),
unionSubclass.isAbstract() != null && unionSubclass.isAbstract(),
getSubselect( node ),
denormalizedSuperTable
);

mappings.addTable doesnt throw exception if the table mapping already exists.

Is the behaviour for joined subclass by design? or its a bug?


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.