-->
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: many-to-one mapping, read with formula
PostPosted: Mon Jun 26, 2006 12:01 pm 
Newbie

Joined: Mon Jun 26, 2006 11:43 am
Posts: 2
Hello,

is it possible to have different mapping-behavior for reading (formula) and writing (normal)?

I have a many-to-one mapping to another class (entity-mapping) eg.

<many-to-one name="state" entity-name="State" >
<column name="state_id" />
</many-to-one>

What I´d like to do is to have a formula for reading this property, but writing should not be affected, eg:

<many-to-one name="state" entity-name="State" formula="select State from State where id=1">
<column name="state_id" />
</many-to-one>

Is that possible?

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 26, 2006 4:09 pm 
Beginner
Beginner

Joined: Wed Jan 25, 2006 10:18 am
Posts: 28
Perhaps you could have two properties, "state" and "stateFromFormula".
Then you can handle your specific logic by changing the code in setState(...) and setStateFromFormula(...).


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.