Posted by
David E Jones-2 on
Sep 14, 2006; 6:57am
URL: http://ofbiz.116.s1.nabble.com/Small-bug-in-Entity-Engine-tp141811p141815.html
This is an interesting issue, and a little tricky. Right now the
Entity Engine only supports case insensitive database meta data. If
we wanted to support both case sensitive and insensitive databases
we'd need to have it be a configuration parameter (probably an
attribute on the datasource element in the entityengine.xml file),
and then treat each case differently in the code.
I don't think it's possible (well, I can't think of a way...) to
handle both case sensitive and insensitive databases with the same
code without knowing which one we're dealing with.
We also need to keep in mind that the intent of the Entity Engine is
that entity definitions are not database specific, so we can't just
look to see if the column name has mixed case characters or something.
-David
On Sep 13, 2006, at 10:30 AM, Andrew Sykes wrote:
> David,
>
> is there any good reason why uppercase should be enforced on user
> defined tables?
>
> This can cause problems if for example you are trying to
> retrospectively
> tie the entity engine to a database table...
>
> - Andrew
>
> On Wed, 2006-09-13 at 04:59 -0600, David E Jones wrote:
>> Hans,
>>
>> Could you describe the actual problem you're having with this?
>>
>> Column names in OFBiz entity definitions are generated by default as
>> upper case and manually defined ones should also be defined this way.
>>
>> -David
>>
>>
>> On Sep 13, 2006, at 2:13 AM, Hans Holmlund wrote:
>>
>>> There is a small bug in Entity Engine DatabaseUtil. When the
>>> metadata is fetched from the database all column names are
>>> converted to capital letters (DatabaseUtil.java row 1047). But when
>>> the entities is checked if they have a corresponding table (and
>>> column) the column names are not converted to uppercase. Therefore
>>> row 206 should look like:
>>> fieldColNames.put(field.getColName
>>> ().toUpperCase(), field);
>>>
>>> / Hans H
>>
> --
> Kind Regards
> Andrew Sykes <
[hidden email]>
> Sykes Development Ltd
>
http://www.sykesdevelopment.com>