Re: Small bug in Entity Engine
Posted by
Hans Holmlund on
Sep 13, 2006; 12:41pm
URL: http://ofbiz.116.s1.nabble.com/Small-bug-in-Entity-Engine-tp141811p141818.html
The problem I had was that the DatabaseUtil thought some columns was not
created in the DB. Because the columns were in mixed case they were not
found by row 217 in DatabaseUtil
// -list all columns that do not have a
corresponding field
if
(fieldColNames.containsKey(ccInfo.columnName)) {
Then they were recreated in row 328 (// -list all fields that do not
have a corresponding column) and onwards.
This does not happen when you define an entity in an xml file, but I
create them dynamically, like:
ModelField field = new ModelField();
field.setName(fieldName);
field.setColName(fieldName);
field.setType(dbType);
/ Hans
David E Jones skrev:
>
> 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
>
>