| 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
 
 
 |