-->
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: Parametrized computed property mapping
PostPosted: Wed Nov 12, 2008 2:26 am 
Newbie

Joined: Wed Nov 12, 2008 2:14 am
Posts: 6
Hi,

how to parametrize computed property mapping?
I have in mapping computed property realized as formula(sql) and need to parametrize it:

Code:
<hibernate-mapping>
    <class name="cz.mikros.w4sn.model.domain.obec.Okres" table="OKRES">
        ...
        <property name="name" column="NAME"/>
        <property name="xxMaxInActualMonth" formula="
          (select MAX(X.FIELD)
          from PROSTOR X
          where X.OKRES_ID = ID AND X.MONTH = :actualMonth) "
        /> 
    </class>
</hibernate-mapping>


Parameter :actualMonth will I set from java-code. Mapping above is incorrect, I dont know how "parametrize" formula-query.


Can you suggest me?
Thanks,
Jara


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 12, 2008 7:33 am 
Newbie

Joined: Wed Nov 12, 2008 2:14 am
Posts: 6
So I still can not "parametrize" my computed property.
Now I use Interceptor.onPrepareStatement() to replace my constants in mapping into real values.

If better solution exists, please suggest me.

Thanks,
Jara


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.