Hi,

1. IN LIST operator support syntax like:

select o from Object o where id in list(1, 2, 3, 4), if values is
numeric and
select o from Object o where id in list("1", "2", "3", "4"), if values
is stringable
To perform automatical list OQL generation I use my framework
(http://sourceforge.net/projects/phantom-castor/) it have OQLPreparator
for it. For example:

List idList = new ArrayList();
idList.add("1");
idList.add("2");
idList.add("3");
String oql = OQLPreparator.prepareOQL(
  new Select(A.class),
  new WhereInList("id", idList)
);

The result will be:
SELECT o FROM package.to.class.A o WHERE id IN LIST("1", "2", "3")

2. What is "contains" operator? I don't know it... Are you sure that it
is avable now?
http://www.castor.org/oql.html#Syntax

Thanks!


-----Original Message-----
From: michael simons [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 02, 2003 3:53 PM
To: [EMAIL PROTECTED]
Subject: [castor-dev] in- or contains-operator


Hi all,

I want to do a query like the following

query = db.getOQLQuery("select t from Tour where $1 in
LIST(t.vehicles)"); query.bind(aVehicle);

or

query = db.getOQLQuery("select t from Tour where t.vehicles
contains($1)"); query.bind(aVehicle);

Does anybody know how to do this (both my attempts lead to exceptions)?

Regards,
michael

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to