-->
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.  [ 1 post ] 
Author Message
 Post subject: Need Formula to return constant string value
PostPosted: Thu Oct 13, 2005 4:42 pm 
Beginner
Beginner

Joined: Wed Jun 01, 2005 6:51 pm
Posts: 27
Location: Philippines
Hibernate version:3.0.5

I have an object that I map to different databases with different hbm mapping files.

I have a field in that object that I want to populate with a constant string value for all objects returned from a particular database with a different value depending on which database it comes from.

I was thinking I could use a <property.../> mapping in the hbm.xml and tried


Code:

<property name="propertyName" type="string" formula="'PARTY'"/>

and

<property name="propertyName" type="string" formula="(select 'PARTY' from TinySurvey)"/>



If formula isn't the right way to do this, any suggestions would be appreciated.

I know I could do this in Java, but I wanted to be loosely coupled and let the hbm.xml do the job.

_________________
Mike "Ollie" Oliver


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

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.