-->
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: Mapping inheritance in cloned tables
PostPosted: Wed May 28, 2008 9:04 am 
Newbie

Joined: Wed May 28, 2008 6:49 am
Posts: 3
Hi all,

i've a question for mapping strategy in inheritance case of study.

I've read guides and forum, but i can't find this specific case.

I'm going to explain you: I have three classes

Content ==> Media ==> Image

Media is a particular specification of a content, and image is a particular specification of a media.

In java code these three class appear:

public class Content ...
public class Media extends Content ...
public class Image extends Media ...

In actual moment i have a SQL schema like this:

Table Content is the only table for three java classes, in this table there is a discriminator:content_def for hibernate.

And three mapping file seems like:

Content:
<class name="Content" discriminator-value="content" table="content" lazy="false">


Media:
<subclass name="Media" extends="Content" discriminator-value="media" lazy="false">


Image:
<subclass name="Image" extends="Media" discriminator-value="image" lazy="false">

starting by this i would like to arrive to another SQL conformation: for performance i had to split content table in 3 table cloned:

1. Content
2. Media
3. Image

this three tables have same common fields and they ARE NOT joined. I want this to avoid a larger number of lines in content table: content should not contain lines for media or image.

I've created new tables in DB, and i've tryied to modify mapping files (with union-subclass, join-subclass) but system doesn't understand that these joined classes (in java) will not be joined in SQL tables.

Anyone can help me?

thanks

nickponico


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.