Class: com.sybase.djc.ant.PersistentFieldProperty (Persistent Field Property) | EAServer 6.3 Help |
---|
Description | This property is used to configure object-relational mapping for a persistent field (entity property) that is generated during deployment of EJB entity beans. |
---|---|
Configuration |
Configuration is achieved using an XML (Ant) configuration script, such as the following: <project name="ejbjar-example-user"> <import file="ant-config-tasks.xml"/> <target name="configure-user"> <setProperties component="ejb.components.example.Customer"> <persistentObject table="my_customer" /> <persistentField field="id" column="c_id" /> <persistentField field="name" column="c_name" maxLength="40" /> </setProperties> </target> </project>This example assumes the prior deployment of an EJB-JAR file named example.jar. The above script would be placed in file ejbjar-example-user.xml in the config directory of your EAServer installation. To run the script, assuming that the bin directory of your EAServer installation is in the PATH, you would use one of the the following commands: recompile ejbjar-example-user (Windows) recompile.sh ejbjar-example-user (Unix / Linux) Alternatively, the above script can be named sybase-ejbjar-config.xml and placed alongside ejb-jar.xml in the META-INF directory inside an EJB-JAR file (prior to deployment). Note: you can define multiple properties, for multiple components, in the same configuration script. |
Nested Properties | column, field, jdbcType, joinTable, maxLength, notNull, precision, readOnly, scale, sqlType, table |
Property: column (Column) | |
---|---|
Description | Specifies the database column name. Defaults to the field name. |
Property: jdbcType (JDBC Type) | |
---|---|
Description |
Specifies the name of a JDBC type (e.g. "TINYINT"). The JDBC type
names are as documented in the Java documentation for class java.sql.Types.
Normally this would be used if you do not want to specify database-specific SQL types (sqlType) because the same persistent object might be used at different times with different types of database. For example, the JDBC type "VARBINARY" could be used to avoid having to specify a SQL type of "varbinary" (for Sybase) or "raw" (for Oracle). Note: if the underlying database column requires special BLOB/CLOB handling, the JDBC type of "BLOB" or "CLOB" should be specified. Otherwise the JDBC driver might truncate data values. |
Property: maxLength (Maximum Length) | |
---|---|
Description | Maximum length for binary or string fields. The interpretation of this for string fields is database-specific. |
Property: notNull (Not Null) | |
---|---|
Description | Specifies that the database column does not permit nulls. |
Default Value | false |
Legal Values | false, true |
Property: precision (Precision) | |
---|---|
Description | For decimal/numeric database columns, specifies the precision. |
Default Value | 0 |
Minimum Value | 0 |
Maximum Value | 2147483647 |
Property: scale (Scale) | |
---|---|
Description | For decimal/numeric database columns, specifies the scale. |
Default Value | 0 |
Minimum Value | 0 |
Maximum Value | 2147483647 |
Property: sqlType (SQL Type) | |
---|---|
Description | Specifies a database-specific SQL type. |