
The following rules for the O/R mapping are required by the EJB Container when you deploy container-managed entity beans on the J2EE Engine. The O/R mapping verification checks whether these rules are fulfilled. If you create your O/R mapping manually, make sure you fulfill all the requirements in this document.
If the following requirements are not fulfilled, the EJB Container cannot guarantee that the abstract schema will work correctly.
The O/R mapping created with the SAP NetWeaver Developer Studio meets all requirements listed below. If you have modified it, we recommend that you switch on the O/R mapping verification. For more information, see Verifying the Object/Relational Mapping .
Enterprise Bean Restrictions
cmp-field Restrictions
Java and JDBC Types
| Java Type | Acceptable JDBC Types | Default JDBC Type |
|---|---|---|
|
java.lang.String |
VARCHAR, CHAR 4 , LONGVARCHAR 3 , CLOB 3 |
VARCHAR |
|
byte[] |
VARBINARY, BINARY 4 , LONGVARBINARY 3 , BLOB 3 |
VARBINARY |
|
java.lang.Byte[] |
VARBINARY, BINARY 4 , LONGVARBINARY 3 , BLOB 3 |
VARBINARY |
|
short |
SMALLINT |
SMALLINT |
|
java.lang.Short |
SMALLINT |
SMALLINT |
|
int |
INTEGER |
INTEGER |
|
java.lang.Integer |
INTEGER |
INTEGER |
|
long |
BIGINT |
BIGINT |
|
java.lang.Long |
BIGINT |
BIGINT |
|
float |
REAL |
REAL |
|
java.lang.Float |
REAL |
REAL |
|
double |
DOUBLE, FLOAT 4 |
DOUBLE |
|
java.lang.Double |
DOUBLE, FLOAT 4 |
DOUBLE |
|
java.math.BigDecimal |
DECIMAL, NUMERIC 4 |
DECIMAL |
|
java.util.Date |
TIMESTAMP |
TIMESTAMP |
|
java.sql.Date |
DATE |
DATE |
|
java.sql.Time |
TIME |
TIME |
|
java.sql.Timestamp |
TIMESTAMP |
TIMESTAMP |
|
java.sql.Clob |
CLOB 3 |
CLOB 3 |
|
java.sql.Blob |
BLOB 3 |
BLOB 3 |
|
boolean |
SMALLINT 1 |
SMALLINT 1 |
|
java.lang.Boolean |
SMALLINT 1 |
SMALLINT 1 |
|
byte |
SMALLINT 2 |
SMALLINT 2 |
|
java.lang.Byte |
SMALLINT 2 |
SMALLINT 2 |
|
java.io.Reader |
VARCHAR 2 |
VARCHAR 2 |
|
java.io.InputStream |
VARBINARY 2 |
VARBINARY 2 |
The value of the cmp-field is serialized to a byte array by using the standard Java serialization mechanism.
This is possible only if the dependent-value class has an empty constructor and all its fields, which are described in the <dv-column> element, are public .
Each public field of the dependent-value class that is described in the <dv-column> element in persistent.xml is mapped to one of the columns in the set. The columns in the set are part of the bean's table, as are the other cmp-fields of the bean. These columns cannot be defined in a separate table. Only the fields described in the <dv-column> element will be stored in the database. The type of these fields can be:
cmr-field Restrictions
One-to-One Relationship
One-to-Many Relationship
Many-to-Many Relationship
Check Limitations
The system is not able to detect the following mistakes in the O/R mapping: