cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John Huss (JIRA)" <>
Subject [jira] [Commented] (CAY-1986) SQLTemplate returning DataObjects fails on PK column case mismatch
Date Wed, 04 Feb 2015 20:03:34 GMT


John Huss commented on CAY-1986:

The fact that some databases (MySQL by default) have case-sensitive column names is ridiculous.
 What a terrible feature.

But even allowing for that, I think cayenne could still be intelligent enough to make it work.
 It could look for exact matches first and then fallback to case-insensitive matches.

> SQLTemplate returning DataObjects fails on PK column case mismatch
> ------------------------------------------------------------------
>                 Key: CAY-1986
>                 URL:
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Core Library
>    Affects Versions: 4.0.M2
>         Environment: trunk
>            Reporter: John Huss
>            Priority: Minor
> If you create an SQLTemplate query that returns real DataObjects (say Artist objects)
and use a query like "select * from Artist limit 1" and have the primary key column defined
in the DataMap with mixed case (like artist_ID) that doesn't match what the database returns
for the column name, the result will contain nulls instead of objects.
> Strangely the case of the other columns does not seem to matter, only the primary key
> You can workaround it by naming the column all upper or lower case and configuring the
SQLTemplate to force upper or lower case column names to be returned.  But I think it should
just work without needing to do this.

This message was sent by Atlassian JIRA

View raw message