Case-sensitivity and default case conversions of DB names depend on the type of 
DB and even on DB configuration, making any assumptions highly unreliable. The 
solution to this issue between case interpretation between Cayenne model and DB 
is to use quotations. around identifiers Quotations make names case-sensitive 
on all databases. Just check "Quote SQL Identifiers" checkbox in the modeler 
next to a DataMap, and use quoted identifiers in your SQL.

FWIW, for the past 2-3 years I switched to this approach everywhere and no 
longer need to guess what capitalization to use.

Andrus


> On Nov 11, 2020, at 4:45 PM, Mark Stobbe <markstobb...@gmail.com> wrote:
> 
> Nice, exactly the solution that I also implemented!!
> 
> On Wed, Nov 11, 2020 at 2:16 PM John Huss <johnth...@gmail.com> wrote:
> 
>> I also dislike this behavior, but I think it is intentional.
>> 
>> As I workaround I lowercase all the DbAttribute names in my DataMap at
>> startup and make sure all my MappedSelects use lowercase names.
>> 
>> On Wed, Nov 11, 2020 at 3:38 AM Mark Stobbe <markstobb...@gmail.com>
>> wrote:
>> 
>>> Hi all,
>>> 
>>> 
>>> 
>>> I was using MappedSelect to query for objects and I was surprised to see
>> I
>>> 
>>> was returned a HOLLOW object. After some investigation I found that
>>> 
>>> in DataRowUtils.refreshObjectWithSnapshot there is a check if we
>>> 
>>> fetched the whole object using a map.
>>> 
>>> 
>>> 
>>> However, the check ("snapshot.containsKey(dbAttrPath)") does not take
>> into
>>> 
>>> account the casing difference between database and datamap. This does
>> work
>>> 
>>> in the rest of Cayenne, but not here.
>>> 
>>> 
>>> 
>>> Mark
>>> 
>>> 
>> 

Reply via email to