These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: list() on an org.hibernate.Query object
PostPosted: Mon Jul 31, 2006 7:27 am 
Newbie

Joined: Fri Jul 28, 2006 11:22 am
Posts: 4
Hi!

I' trying to understand the function list() which I want to use on an org.hibernate.Query object.

Code:
public List getTranslationStringFor(MyObject object) throws InfrastructureException {
        List queryResult = null;
        try {
            org.hibernate.Session sess = HibernateUtil.getSession();
            String statement = getStatement("MyStatement",
                                            new Object[] {
                                                object.getType(), object.getUniqueId()}
                                            );
            org.hibernate.Query query = sess.createQuery(statement);

            queryResult = query.list();

            }
} catch (HibernateException e) {
            throw new InfrastructureException(e);
        }
        return queryResult;

public String getStatement(String which, Object[] arguments) {
        return MessageFormat.format(getStatement(which), arguments);
    }


object.getType() and object.getId() each return strings.

Some get() methods of other classes are automatically called while running query.list(); But the objects of this methods are not mentioned in this context.
Can anyone try to explain to me why Hibernate uses these get Methods?

Thank you!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 31, 2006 10:23 am 
Senior
Senior

Joined: Wed Jun 15, 2005 4:17 am
Posts: 156
I would suggest you to post in the main Hibernate forum, this one is the NHibernate forum which deals with the C# port of Hibernate.

Cheers,
Radu


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.