-
1. Re: I need a finder to return lowest value of a column in a
davidjencks Dec 19, 2001 10:17 AM (in response to joe543)I think you'd specify the where clause like this:
column_name = (select min(t.column_name) from table_name t)
Note you need the alias t for the nested subquery, and the finder should return a collection. -
2. Re: I need a finder to return lowest value of a column in a
joe543 Dec 19, 2001 12:13 PM (in response to joe543)I gather this would be defined in a deployment descriptor - correct?
Where do I go to find out how to set this up? (i.e. is this part of ejb-ql or is it pre 2.0?)
joe -
3. Re: I need a finder to return lowest value of a column in a
davidjencks Dec 20, 2001 1:48 AM (in response to joe543)Its in cmp 1 and 2 both, I think the both free and for pay docs have a good discussion, and there are examples on the website I think.
-
4. Re: I need a finder to return lowest value of a column in a
markd Dec 20, 2001 11:38 AM (in response to joe543) -
5. Re: I need a finder to return lowest value of a column in a
joe543 Dec 21, 2001 10:08 AM (in response to joe543)Hi,
I managed to get it to work using the folowing in my application's jaws.xml:
<enterprise-beans>
<ejb-name>CDBean</ejb-name>
findLeastHit
where id = (select min(t.id) from cdbean t)
</enterprise-beans>
The above was simply a 'proof-of-concept'. Thanks for the help!
When would it be appropriate to utilize a tag (as opposed to including the clause within the query)?
Joe -
6. Re: I need a finder to return lowest value of a column in a
davidjencks Dec 21, 2001 10:11 AM (in response to joe543)I might have made up the where tag or it might be cmp2 only. My advice was from memory, not recent use.