Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-dev] default column size for text columns

Hi Tom, Mitesh,

I'd just like to confirm something about the Java to platform SQL type
mappings.
According to the JPA spec, fields with no 'length' attribute on their
columns definitions default to 255:

int length() default 255

According to my JPA book (Mike Keith's) this applies to all character types.
But DerbyPlatform has the following mappings:

  fieldTypeMapping.put(Character[].class, new
FieldTypeDefinition("CLOB", MAX_CLOB));
  fieldTypeMapping.put(java.sql.Clob.class, new
FieldTypeDefinition("CLOB", MAX_CLOB));

with MAX_CLOB defined as:

public static final int MAX_CLOB = 2147483647;  //The maximum clob/blob
size is 2 gigs in Derby.

Shouldn't they use 255 instead of its maximum?

  fieldTypeMapping.put(Character[].class, new
FieldTypeDefinition("CLOB", 255));
  fieldTypeMapping.put(java.sql.Clob.class, new
FieldTypeDefinition("CLOB", 255));

I was about to use max for Symfoware as I was referring to DerbyPlatform
for reference, but this doesn't look right.

Thanks,
Dies



Back to the top