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 a property to a SQL-function
PostPosted: Tue Dec 12, 2006 4:50 am 
Newbie

Joined: Tue Dec 12, 2006 4:40 am
Posts: 1
hi @ all
is it possible to map a property to a SQL function? the related query would probably look like this:

SELECT id, name, getStatus(id) AS status FROM MyTable

i would like to map that to a class with the properties id, name and status.

thanks for any help!
greez simon


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 12, 2006 5:22 am 
Regular
Regular

Joined: Tue Aug 08, 2006 4:28 am
Posts: 96
Location: Hong Kong
Hi Greez,

I haven't tried this but it should work according to the documentation.

Please try setting the status property in this way:
Code:
<property name="status" formula="getStatus(id)" />

Please note that you may need to provide the type and access attribute according to your implementation.

Canton


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.