cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Garth Keesler <gar...@gdcjk.com>
Subject Re: PG CITEXT Data Type
Date Tue, 30 Oct 2012 16:06:24 GMT

Thanx for the reply. The problem I seem to be having is that the 
schema-generated persistent classes have errors whenever one of the 
CITEXT attributes is mentioned. Following is a sample of the code which 
is causing errors.

public void setInvoicenbr($importUtils.formatJavaType(${attr.Type}) 
invoicenbr) {
         writeProperty(INVOICENBR_PROPERTY, invoicenbr);
     }
     public $importUtils.formatJavaType(${attr.Type}) getInvoicenbr() {
         return 
($importUtils.formatJavaType(${attr.Type}))readProperty(INVOICENBR_PROPERTY);
     }

The errors are the same for each occurrence of the CITEXT data type.

Description    Resource    Path    Location    Type
$ cannot be resolved to a variable    _Lineitems.java 
/oespg/src/main/java/org/ttna/oespg/persistent/auto    line 80 Java Problem

If this is not helpful, let me know and I'll include schema and more code.

Thanx,
Garth

On 10/30/2012 10:10 AM, Andrus Adamchik wrote:
> I don't have much recent firsthand PG experience, but reading citext docs, it looks like
exactly what you need.
>
> So when comparisons are done in SQL it should work (at least it works for me on MySQL
with similar DB-side settings). On the other hand if you are using in-memory filtering with
expressions it won't work, as in-memory comparisons are simple Java "equal".
>
> Finally there is a 'likeIgnoreCase' expression that works consistently in-memory and
in DB (regardless of DB-side case sensitivity), as the name implies.
>
> Andrus
>
>
> On Oct 30, 2012, at 2:54 PM, Garth Keesler<garthk@gdcjk.com>  wrote:
>
>> I'm converting an MS Access ADP project to Java/Postgresql/Cayenne (my first and
mostly for the fun of it) and am trying to figure out how to best match the case insensitive
string usage that is in SQL Server. I created the PG database using CITEXT only where actually
necessary but it doesn't seem to be recognized in Cayenne. It appears that I need to replace
all CITEXT columns with TEXT and handle case insensitive comparisons manually. I've found
a couple of threads that mention this but none had any real advice on how best to do it in
a Cayenne environment. Lower() is frequently mentioned as the usual approach but before I
go down that path too far I'd appreciate a little feedback from more experienced Cayenne users.
>>
>> Thanx Much,
>> Garth
>>
>



Mime
View raw message