-->
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: too many tables
PostPosted: Mon May 29, 2006 11:41 am 
Newbie

Joined: Mon May 29, 2006 9:06 am
Posts: 1
I am relatively new to hibernate, I have too many tables in the Database by using table per subclass approach.
Is there any way to reduce these tables by adapting a combination of different strategies.My hbm file looks like this.
Thanks in advance





<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="com.cinerent.yeti.model.user.IFinancialBody" table="USERS" abstract="true" lazy="false">
<id name="id" type="long" unsaved-value="null" column="USER_ID">
<generator class="identity"/>
</id>
<many-to-one lazy="false" name="ledger" column="FK_LEDGER" class="com.cinerent.yeti.model.financial.ILedger" not-null="false" cascade="all"/>


<joined-subclass abstract="true" lazy="true" name="com.cinerent.yeti.model.user.IMandator">
<key column="USER_ID"/>
<property name="name" column="NAME" not-null="false" unique="true"/>
<joined-subclass name="com.cinerent.yeti.model.user.impl.MandatorImpl" table="MANDATORS" lazy="true">
<key column="MANDATOR_ID"/>
</joined-subclass>
</joined-subclass>



<joined-subclass abstract="true" name="com.cinerent.yeti.model.user.IPromoter" lazy="true">
<key column="USER_ID"/>
<property name="name" column="NAME" not-null="false" unique="true" />
<many-to-one name="mandator" column="FK_MANDATOR" class="com.cinerent.yeti.model.user.IMandator" not-null="false"/>
<list name="products" cascade="all, all-delete-orphan">
<key column="FK_PROMOTER"/>
<list-index column="LIST_INDEX" base="0"/>
<one-to-many class="com.cinerent.yeti.model.product.IProduct"/>
</list>
<joined-subclass name="com.cinerent.yeti.model.user.impl.PromoterImpl" table="PROMOTERS" lazy="true">
<key column="USER_ID"/>
</joined-subclass>
</joined-subclass>



<joined-subclass abstract="true" name="com.cinerent.yeti.model.user.IUser">
<key column="USER_ID"/>
<property name="username" column="USERNAME" unique="true"/>
<property name="lastLogin" column="LAST_LOGIN" type="org.joda.time.contrib.hibernate.PersistentDateTime" not-null="false"/>
joined-subclass abstract="true" name="com.cinerent.yeti.model.user.IConsumer">
<key column="USER_ID"/>
<many-to-one name="secretQuestion" column="FK_SECRET_QUESTION"class="com.cinerent.yeti.model.user.ISecretQuestion" not-null="false"/>
<property name="secretAnswer" column="SECRET_ANSWER" />
<many-to-one name="billingAddress" column="FK_BILLING_ADDRESS" class="com.cinerent.yeti.model.user.IAddress" cascade="all"/>

<list name="consumerCards" cascade="all, all-delete-orphan">
<key column="FK_CONSUMER" not-null="true"/>
<list-index column="LIST_INDEX" base="0"/>
<one-to-many class="com.cinerent.yeti.model.user.IConsumerCard"/>
</list>
<joined-subclass name="com.cinerent.yeti.model.user.impl.ConsumerImpl" table="CONSUMERS">
<key column="USER_ID"/>
</joined-subclass>
</joined-subclass>

</joined-subclass>
</class>

</hibernate-mapping>


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.