-->
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: How to map single ID like a Component property ?
PostPosted: Sat Apr 02, 2005 8:19 am 
Newbie

Joined: Fri Mar 25, 2005 5:01 am
Posts: 6
Hibernate version: all


I want to store my ID field in a wrapper class (OID) like a Component.

How can I do this ?


My Java class:

public class MetaElement
{
public OID guid = OID.NULL();
...
public OID owner = OID.NULL();
}

My Mapping:


<hibernate-mapping>

<class name="Jase.metamodel.MetaElement" table="TC_METAELEMENT" discriminator-value="C">

<id name="guid" type="java.lang.String" access="property" >
<column name="c_guid" not-null="true" unique="false" sql-type="VARCHAR(255)" />
<generator class="hilo">
<param name="table">t_sequence</param>
<param name="column">guid</param>
<param name="max_lo">100</param>
</generator>
</id>

How to map the id like the component property ?

<component name="owner" class="Jase.common.OID">
<property name="string" type="java.lang.String">
<column name="c_owner" not-null="false" sql-type="VARCHAR(255)" />
</property>
</component>


( OID has a setString/getString property wich has to take the sequence value )



[/b]


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 05, 2005 1:08 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
check the reference documentation, <composite-id>

_________________
Emmanuel


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.