Skip to main content

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

Hi Dies,

  The thing to keep in mind here is that JPA is only part of what EclipseLink does.

Classes in org.eclipse.persistence.core should do what is correct from a general point of view (i.e. JPA's opinion of what the defaults should be is only one of the things to consider)

Classes in org.eclipse.persistence.jpa are the classes that implement that JPA-specific functionality. If there is a mismatch between the JPA specification's defaults and the defaults in our core project, that is where we address them.


Dies Koper wrote:
Hi Tom, Mitesh,

I'd just like to confirm something about the Java to platform SQL type
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.


eclipselink-dev mailing list

Back to the top