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: field (Field)
Description Required. Specifies the name of the field which is to be made persistent. If a field "x" has a Java type which is itself made of public fields "y" and "z", you can separately map the sub-fields by using compound field names. For example, you can have one persistentField property for "x.y", and one for "x.z". This is also known as attribute flattening.

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: joinTable (Join Table)
Description Store column in a join table. For example, if entity "A" (with table "A_tab") has a primary key field "pk" and a field "fk" which is a foreign key for entity "B" (with table "B_tab"), then a join table "AB_tab" might be used to store the foreign key, rather than the foreign key being present in "A_tab". Note that the join table must also contain a column for "pk". If the column name for field "pk" in table "AB_tab" differs from the column name for field "pk" in table "A_tab", then multiple persistentField elements should be used for field "pk", e.g.
  <persistentObject table="A_tab"/>
  <persistentField field="pk" column="pk_col1"/>
  <persistentField field="pk" joinTable="AB_tab" column="pk_col2"/>
  <persistentField field="fk" joinTable="AB_tab" column="fk_col"/>
        
Default Value false
Legal Values false, true

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: readOnly (Read Only)
Description Mark a field as read only. In a one-to-one relationship that uses a join table, both entities ("A" and "B") would separately reference the join table. One of these entities should declare the foreign key fields as read-only. The other entity is considered to be the "owner" of the join table, and should declare the foreign key fields as non-read-only.
Default Value false
Legal Values false, true

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.

Property: table (Table)
Description Store column in a secondary table. The persistent fields of an entity may be stored in multiple tables. The name of the primary table must be indicated using the "table" property of the persistentObject property. The names of any secondary tables muet be indicated using the "table" property of the persistentField property, e.g.
  <persistentObject table="cust_tab">
  <persistentField field="id" column="cust_id"/>
  <persistentField field="name" column="cust_name"/>
  <persistentField field="address" table="addr_tab" column="cust_addr"/>