I am using the following method to get back a list of objects based on ids.
What I would prefer is to get back a list of objects sorted by object.name.
I know there's an easier way to do this with hibernate, but I can't seem to
find it.

            // loop through the list of headend ids and get their names
            for (int i = 0; i < headendIds.size(); i++) {

                headend = (Headend) headendIds.get(i); // get the id

                Long headendId = headend.getId();
                if (log.isDebugEnabled()) {
                        log.debug("looking for headend with id: " +
headendId);
                }
                headend = (Headend) ses.load(Headend.class, headendId); //
get the headend

                if (headend == null) {
                    log.error("No headend name found for id: " + headendId);
                    throw new DAOException("No headend name found for id: "
+
                                           headendId);
                } else {
                        if (log.isDebugEnabled()) {
                                log.debug("returning headend with name: " +
headend);
                        }
                }

                // replace the object in the list
                headendList.add(i, headend);
            }

Thanks,

Matt





-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel

Reply via email to