Announcement Announcement Module
Collapse
No announcement yet.
hibernate filter on collection data member Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • hibernate filter on collection data member

    Hi,

    I am trying to initialize a collection in MyObject. I used filter like this


    return (List)getHibernateTemplate().execute(new HibernateCallback() {
    public Object doInHibernate(Session session)
    throws HibernateException {
    session.createFilter(MyObj.getCollections(), "order by this.createDt")
    .setFirstResult(0)
    .setMaxResults(20)
    .list();

    This works fine. However, the problem is, I am expecting one select will be generated (with table join of course). But instead, in Hibernate3, 20 select statements are generated (no join used). Obviously, this results in a performance degrade...

    So, my friend, Is that the correct behavior or am I doing something wrong?

    Thanks,

    Joe

  • #2
    You may want to try posting here:

    http://forum.hibernate.org/viewforum.php?f=1

    (I'd answer your question if I knew the answer)

    Comment

    Working...
    X