-->
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: Mapping of Custom Identifier
PostPosted: Fri Jan 12, 2007 10:35 am 
Newbie

Joined: Fri Jan 12, 2007 10:14 am
Posts: 1
I have a custom class that encapsulates the identifier. How do I do the id mapping so that the generator accesses the Id property of UniqueIdentifier as below?

<class name="Person" table="Persons">
<id name="Id" access="nosetter.camelcase" column="Id">
<generator class="guid" />
</id>
</class>

My business object:

public class Person
{
private UniqueIdentifier id;
public UniqueIdentifier Id
{
get { return id; }
}
}

public class UniqueIdentifier
{
private Guid id;
public Guid Id
{
get{ return id; }
set{ id = value; }
}
}


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 12, 2007 7:45 pm 
Contributor
Contributor

Joined: Sat Sep 24, 2005 11:25 am
Posts: 198
You will probably need to create a custom generator for that.


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.