Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
3.0
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
Mysql 5.0.38
I am doing something along the following
Query query =
session.createQuery("from org.spirit.bean.impl.BotListCoreUsers user where user.userName = :userName order by user.createdOn desc LIMIT 0, 50");
String finUser = KeywordProcessor.filterAlphaNumeric(userName);
query.setString("userName", finUser);
query.setMaxResults(50);
BotListCoreUsers user = (BotListCoreUsers) query.uniqueResult();
List l = user.getLinks();
// lazy load the link
for (Iterator it = l.iterator(); it.hasNext(); ) {
Object obj = it.next();
}
I am loading a "one-to-many" relationship and on the "many" "user.getLinks() ... how can I limit the number of results?
Limit the results of the "one-to-many" at this comment "// lazy load the link"
Berlin Brown
http://www.botspiritcompany.com