-->
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: composite-id in a separate mapping file
PostPosted: Tue Jan 02, 2007 6:55 am 
Newbie

Joined: Tue Jan 02, 2007 6:48 am
Posts: 3
I would like to have
Code:
composite-id
class mapping in a separate file (because I want to reuse this composite-id in more than one class). Is that possible?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 03, 2007 4:34 am 
Regular
Regular

Joined: Thu Aug 17, 2006 4:50 am
Posts: 55
Location: Mallorca
You can use entity references:

Code:
<?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" [
        <!ENTITY id SYSTEM "included.xml" >
]>


<hibernate-mapping package="domain">

  <class name="Parent" table="TEST_PARENT" >

      &id;
      <property name="name" column="NAME" />

     ... continues ....


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.