Specifies field-specific column attributes in property subelements.
cmp-resource (sun-ejb-jar.xml)
The following table describes subelements for the schema-generator-properties element.
Table A–96 schema-generator-properties Subelements
Element |
Required |
Description |
---|---|---|
zero or more |
Specifies a property name and value. |
The following table describes properties for the schema-generator-properties element.
Table A–97 schema-generator-properties Properties
Property |
Default |
Description |
---|---|---|
false |
Specifies that generated table names are unique within each application server domain. This property can be overridden during deployment. See Table 7–4. |
|
bean-name.field-name.attribute |
none |
Defines a column attribute. For attribute descriptions, see Table A–98. |
The following table lists the column attributes for properties defined in the schema-generator-properties element.
Table A–98 schema-generator-properties Column Attributes
Attribute |
Description |
---|---|
jdbc-type |
Specifies the JDBC type of the column created for the CMP field. The actual SQL type generated is based on this JDBC type but is database vendor specific. |
jdbc-maximum-length |
Specifies the maximum number of characters stored in the column corresponding to the CMP field. Applies only when the actual SQL that is generated for the column requires a length. For example, a jdbc-maximum-length of 32 on a CMP String field such as firstName normally results in a column definition such as VARCHAR(32). But if the jdbc-type is CLOB and you are deploying on Oracle, the resulting column definition is CLOB. No length is given, because in an Oracle database, a CLOB has no length. |
jdbc-precision |
Specifies the maximum number of digits stored in a column which represents a numeric type. |
jdbc-scale |
Specifies the number of digits stored to the right of the decimal point in a column that represents a floating point number. |
jdbc-nullable |
Specifies whether the column generated for the CMP field allows null values. |
<schema-generator-properties> <property> <name>Employee.firstName.jdbc-type</name> <value>char</value> </property> <property> <name>Employee.firstName.jdbc-maximum-length</name> <value>25</value> </property> <property> <name>use-unique-table-names</name> <value>true</value> </property> </schema-generator-properties>