Question

I have the following code. What I am trying to find out is if I can change the number 5 to value from a domain class.E.g Domain.getNumber. Can i use #Number# in place of 5. If not is there a way to get that?

<select id="searchClassOverviewCount" resultClass="int"
    parameterClass="com.school.business.domain.SchoolCriteriaDomain">
    select count(*)
    from Class
    where 
 'SqlMap-School.searchClassOverviewCount' =
                          'SqlMap-School.searchClassOverviewCount'
     <isNotEmpty prepend="and" property="globalSearchPattern">
        (
            right(repeat('0', 5) || NUMBER, 5) 
                   || '-' || 
            right(repeat('0', 2) || RNUMBER, 2) 
                  like upper('%$globalSearchPattern$%')
     </isNotEmpty>
</select>
Was it helpful?

Solution

Yes you can.

All you have to do is replacing 5 to #number#.

However, number must be a member variable of the com.school.business.domain.SchoolCriteriaDomain and has name "number" Not "Number".

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top