In an effort to "shorten things up" and order by name alphabetically by Name
(ignoring case), I'm doing the following:

String clazz = MSO.class.getName();
Query q = ses.createQuery("from m in class "+clazz+" where m.id in
(:id_list) order by upper(m.name)");
q.setParameterList("id_list", msoIds);

msoList = q.list();

My reasoning for using class.getName() is because of the long package name:
com.comcast.cable.dmc.itd.cct.persistence.MSO.

This seems to work great, just wanted to see if there's anything wrong with
this - or a better way to do it.

Thanks,

Matt

-----Original Message-----
From: Raible, Matt 
Sent: Friday, January 03, 2003 1:07 PM
To: '[EMAIL PROTECTED]'
Subject: RE: [Hibernate] Getting a sorted list of results


And so it begins - I eliminated about 100 lines of code by passing in a List
of longs, vs. a List of objects with their id's set.  

Matt

------------- Forwarded message -------------
> This *looks* to be exactly what I'm looking for, however, I'm getting an
> "inconsistent datatypes" error from Oracle.  Is there something I need
to do
> to get :id_list to be recognized as Longs? 

Well, by the looks of your code, you aren't *actually* passing in a List
of Longs....it looks like you're passing instances of Headend. If you
pass a List of java.lang.Long I would expect it to work.

Alternatively you could use:

q.setParameterList(
  "id_list", 
  headends,    // a list of Headend instances
  Hibernate.association(Headend.class) // the Hibernate Type for Headend
);

Gavin

---------------------------------------------------------------------
Never lose a fax again, receive faxes to your personal email account!
Visit http://www.mbox.com.au/fax

-------------------------------------------------------
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

-- Matt Raible, Raible Designs, Morrison CO US
-- Tel: +1 303 979-5340
-- Mob: +1 720 560-8460
-- Fax: +1 508 256-6471
-- Web: http://www.raibledesigns.com



-------------------------------------------------------
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