How can I do something like the following, the hibernate way??
select * from foo where bar='baz' order by RAND() LIMIT 0,1;
Of course what I am doing here is selecting a single random row (object)
Thanks,
Ron
---
This SF. Net email is sponsor
session.createQuery("from Foo foo where foo.bar='baz' order by rand()")
.setMaxResults(1)
.uniqueResult();
rjf wrote:
How can I do something like the following, the hibernate way??
select * from foo where bar='baz' order by RAND() LIMIT 0,1;
Of course what I am doing here is selecting a sin
How can I do something like the following, the hibernate way??
select * from foo where bar='baz' order by RAND() LIMIT 0,1;
Of course what I am doing here is selecting a single random row (object)
Thanks,
Ron
---
This SF.Net email sponsored