Re: likeIgnoreCase queries and EJBQL

2015-10-13 Thread Hugi Thordarson
Admirable effort and duly noted. I know I’d have loved it if someone did this before me and shared the result, so I’ll keep the Informix-specific stuff separate from everything else and we’ll see if this ends up going far enough to make the DB in question “cayenne compatible”. It’s a reeeaaally

Re: likeIgnoreCase queries and EJBQL

2015-10-13 Thread Mike Kienenberger
We are willing to support older obsolete versions of databases as well as new ones. :) Our Oracle driver code is an example of how we support multiple driver versions. On Tue, Oct 13, 2015 at 11:16 AM, Hugi Thordarson wrote: > I’m not sure how useful my work would be since I’m writing against

Re: likeIgnoreCase queries and EJBQL

2015-10-13 Thread Hugi Thordarson
I’m not sure how useful my work would be since I’m writing against a 15 year old Informix version, incompatible with modern JDBC-drivers (for example, modern Informix JDBC drivers support {fn ucase} just fine). We’re planning to switch this customer to Postgres as soon as they have the resources

Re: likeIgnoreCase queries and EJBQL

2015-10-13 Thread Andrus Adamchik
Awesome. Congrats :) Perhaps with your help we can create a fully working Informix adapter in Cayenne? Andrus > On Oct 13, 2015, at 10:49 AM, Hugi Thordarson wrote: > > Eeek—I actually did it, and it works like a charm! Found out my factory > needed to override getConditionTranslator(), not

Re: likeIgnoreCase queries and EJBQL

2015-10-13 Thread Hugi Thordarson
Eeek—I actually did it, and it works like a charm! Found out my factory needed to override getConditionTranslator(), not getSelectTranslator(). https://gist.github.com/hugith/f04fd044b59c4ce60aa9 For the first time, I feel like a total Cayenne Boss™ :) - hugi > On 13. okt. 2015, at 14:45, Hu

Re: likeIgnoreCase queries and EJBQL

2015-10-13 Thread Hugi Thordarson
> {fn ucase} is JDBC escape syntax, so presumably the driver should convert > that to the proper syntax. If a given driver is not capable of doing that, > that has to be addressed in DbAdapter for that DB. > DbAdapter.getEjbqlTranslatorFactory() is how you customize EJBQL translation. > So Mike

Re: likeIgnoreCase queries and EJBQL

2015-10-13 Thread Andrus Adamchik
{fn ucase} is JDBC escape syntax, so presumably the driver should convert that to the proper syntax. If a given driver is not capable of doing that, that has to be addressed in DbAdapter for that DB. DbAdapter.getEjbqlTranslatorFactory() is how you customize EJBQL translation. So Mike is right a

Re: likeIgnoreCase queries and EJBQL

2015-10-13 Thread Hugi Thordarson
Thanks Mike! I’m not sure it this is a database plugin problem though. Doing regular case insensitive queries works fine, it’s only queries created from EJBQL that fail. Also, the only place in the Cayenne sources I can find a mention of “ucase" is in EJBQLTranslator’s visitUpper(). Perhaps cha

Re: likeIgnoreCase queries and EJBQL

2015-10-12 Thread Mike Kienenberger
Sounds like the DbAdaptor for that database needs to be special-cased. Lots of examples of how this is done in cayenne/dba//*, especially for oracle And it's pretty simple to set your app up to use a custom version of the dbAdaptor if you don't want to build your own custom version of cayenne wh

likeIgnoreCase queries and EJBQL

2015-10-12 Thread Hugi Thordarson
Hi all. I’m communicating with a database that doesn’t have the UCASE function, only UPPER. When I use case insensitive expressions (for example, User.NAME.likeIgnoreCase(“Bob”)) in a regular SelectQuery, Cayenne generates SQL using the “UPPER” function (for expressions generated using likeIg