The jbosscmp-jdbc.xml file contains mappings from EJB attributes to database columns used by Container-Managed Persistence (CMP) and Container-Managed Relationships (CMR).
The rule detects CMP field mappings in the jbosscmp-jdbc.xml file. The automated fix will attempt to generate the mappings needed by WebSphere(R) Application Server for the Container-Managed Persistence to work. The mappings are sensitive to the database type and schema. The automated fix will make a best-guess effort at choosing a correct schema for the database.
The database vendor can be configured in the properties panel of the rule. If set to Auto detect, the database-type setting in the jbosscmp-jdbc.xml file determines the type of database used. If none is specified, DB2 is used. Only DB2(R), Oracle, SQLServer, and SQLServer2000 are supported database types. MySQL, POINTBASE, Informix(R), and Sybase cannot be migrated.
The following table displays the Java type to database column type used. If your database table schema deviates from this format, or if custom data types are specified in the jbosscmp-jdbc.xml file, then CMP might not work. In those cases, use the Meet-In-The-Middle setting in the EJB to RDB Mapping Wizard of Rational Application Developer to migrate the CMP mappings.
| Java Type | DB2 | Oracle | SQLServer |
|---|---|---|---|
| java.lang.Integer/int | INTEGER | INTEGER | INTEGER |
| java.lang.Double/double | DOUBLE PRECISION | DOUBLE PRECISION | DOUBLE PRECISION |
| java.lang.Float/float | FLOAT | FLOAT | FLOAT |
| java.lang.Short/short | INTEGER | INTEGER | SMALLINT |
| java.lang.Long/long | BIGINT | INTEGER | DECIMAL |
| java.math.BigDecimal | DECIMAL | DECIMAL | DECIMAL |
| java.lang.String | VARCHAR | VARCHAR | VARCHAR |
| java.lang.Character/char | CHAR | CHAR | CHAR |
| java.lang.Byte/byte | INTEGER | INTEGER | TINYINT |
| java.lang.Boolean/boolean | INTEGER | INTEGER | INTEGER |
| java.sql.Date | DATE | DATE | DATETIME |
| java.sql.Time | TIME | DATE | DATETIME |
| java.sql.Timestamp | TIMESTAMP | DATE | DATETIME |
| byte[]/java.io.Serializable | VARCHAR FOR BIT DATA | RAW | IMAGE |