-->
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: Combining many to many association with DB partitions
PostPosted: Mon Dec 03, 2012 7:04 am 
Beginner
Beginner

Joined: Sat Jan 05, 2008 7:33 am
Posts: 26
Let's assume I have 2 mapped entities which are related as follows:

<hibernate-mapping default-lazy="false" default-cascade="all" package="myentities">
<class name="TableOfContents" table="TblOfContents">
<id name="dbId" column="db_id" type="long">
<generator class="native"/>
</id>
<timestamp name="lastModified" column="last_modified" source="db"/>
<property name="created" type="timestamp" insert="false" update="false" generated="insert"/>
<property name="digest" column="digest" type="string"/>

<!-- IMPORTANT Note: The following "key" pseudo property describe the "unicity" of a TOC object in the DB -->
<properties name="key" unique="true">
<property name="active" column="is_active" type="boolean" not-null="true" index="ix_toc_ac"/>
<property name="partId" type="long"> <column name="partition_id" index="ix_toc" not-null="true" default="0"/> </property>
<property name="name" column="entry" type="string" not-null="true" index="ix_tocs"/>
</properties>

<set lazy="true" name="entries" table="lt_toc_entries">
<key column="toc_id" foreign-key="fk_toc_entry"/>
<many-to-many class="TOCEntry" column="entry_id" foreign-key="fk_entry_toc"/>
</set>
</hibernate-mapping>

<hibernate-mapping default-lazy="false" default-cascade="all" package="myentities">
<class name="TOCEntry" table="TOCEntries">
<id name="dbId" column="db_id" type="long">
<generator class="native"/>
</id>
<timestamp name="lastModified" column="last_modified" source="db"/>
<property name="created" type="timestamp" insert="false" update="false" generated="insert"/>
<property name="digest" column="digest" type="string"/>

<!-- IMPORTANT Note: The following "key" pseudo property describe the "unicity" of a TOCEntry object in the DB -->
<properties name="key" unique="true">
<property name="active" column="is_active" type="boolean" not-null="true" index="ix_tocentries_ac"/>
<property name="partId" column="partition_id" type="long" not-null="true" index="ix_tocentries"/>
<property name="fulltext" column="fulltext" length="800" type="string" not-null="true" index="ix_tocentries"/>
<property name="TOCId" column="toc_id" type="long" not-null="true" index="ix_tocentries_id"/>
</properties>
</hibernate-mapping>

this way both entities are linked: from a given TOC I can get the associated TOCEntries and reversely using the toc_id of a TOCEntry
Say I have 1.5 million entries in the TOC table and 280 million entries in the
I managed to split both tables using MySQL partitioning on partition_id column however the
lt_toc_entries table which contains around 280 million entries is not partitioned
Is there a way to achieve my goal
Thanks for any help


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.