Tips: Declare cmp-field in Jboss 5.0.0.CR1 version

written by aext on September 5, 2008 in Quick Tips with no comments

After add jboss ejb property from XDoclet setting. We can run Xdoclet with MyEclipse then cmp-field will be auto create by XDoclet. But, in jboss 5.0.0.CR1 version, cmp must match (field-name, read-only? read-time-out?, conlum-name?, not-null?, ((jdbc-type, sql-type)|(property+))?)

So, you must declare those by adding following line in the top of ejb bean class:

* @jboss.unknown-pk class="java.lang.Integer"
 *   read-only="true"
 *   read-time-out="6000"
 *   column-name="article_id"
 *   not-null="true"
 *      jdbc-type="INTEGER"
 *      sql-type="int"

It will resolved problem when deloying cmp to Jboss server 5.0.0.CR1 with error:…. “cmp-field” must match (field-name, read-only? read-time-out?, conlum-name?, not-null?, ((jdbc-type, sql-type)|(property+))?)…