-->
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.  [ 2 posts ] 
Author Message
 Post subject: Representing Hierarchical structures
PostPosted: Thu Oct 04, 2007 5:55 am 
Newbie

Joined: Thu Oct 04, 2007 5:46 am
Posts: 2
Hi,

Is it possible to represent object hierarchies in Hibernate? I would like to persist a node object, which can contain one or more node objects (of the same type), creating a hierarchical structure.

Any help would be very appreciated,
Thanks
Matt


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 04, 2007 9:01 am 
Regular
Regular

Joined: Tue Feb 24, 2004 11:42 am
Posts: 56
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping>
<class dynamic-update="true" table="TEAM_UPDATE_WINDOW" dynamic-insert="true" name="com.newsint.fantasygames.domain.game.TeamUpdateWindow">
<id unsaved-value="null" name="id" type="long">
<column name="TEAM_UPDATE_WINDOW_ID" not-null="true"/>
<generator class="sequence"/>
</id>
<many-to-one column="TEAM_UPDATE_WINDOW_TYPE_ID" foreign-key="UPDATE_SESSION_TYPE_FK" class="com.newsint.fantasygames.domain.game.TeamUpdateWindowType" lazy="true" name="teamUpdateWindowType"/>
<property name="costOfTeamUpdateWindow" column="COST"/>
<property name="noOfTransfersApplicable" column="NO_OF_TRANSFERS_APPLICABLE"/>
<many-to-one column="CURRENCY" foreign-key="CURR_UPDATE_SESSION_FK" class="com.newsint.fantasygames.domain.Currency" lazy="true" name="currency"/>
<property name="endDate" column="END_DATE"/>
<property name="startDate" column="START_DATE"/>
<property name="showTransfers"/>
<many-to-one column="PARENT_ID" foreign-key="PARENT_UPDATE_SESSION_FK" class="com.newsint.fantasygames.domain.game.TeamUpdateWindow" lazy="true" name="parentWindow"/>
<list inverse="false" lazy="true" name="windows">
<key column="PARENT_ID"/>
<list-index column="DISPLAY_IDX" base="0"/>
<one-to-many class="com.newsint.fantasygames.domain.game.TeamUpdateWindow"/>
</list>
<property name="leniencyCutoff"/>
<property name="allowTransfers"/>
</class>
</hibernate-mapping>
please rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

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.