哈哈 我这两天就为这个烦着 终于解决了Lomboz不支持直接设但是你可以通过修改 xDoclet的标签实现
写一个class level 的xDoclet 的标签@ ejb.pk class="*****PK"
然后在每个cmp field 的方法前写一个 method level的标签
@ ejb.pk-field部分代码如下
....
 * 
 *  @ejb.persistence 
 *   table-name="results" 
 * 
 * @ejb.finder 
 *    query="SELECT OBJECT(a) FROM resultSchema as a"  
 *    signature="java.util.Collection findAll()"  
 *
 * @ejb.pk class="csc.resultPK"
 *--
 * This is needed for JOnAS.
 * If you are not using JOnAS you can safely remove the tags below.
 * @jonas.finder-method-jdbc-mapping  method-name="findAll"
 * jdbc-where-clause=""
 * @jonas.jdbc-mapping  jndi-name="j2ee_project"
 * jdbc-table-name="results"
 * 
 *--
 * <!-- end-xdoclet-definition -->
 * @generated
 **/
public abstract class resultBean implements javax.ejb.EntityBean {....... /**
   *
   *
   * <!-- begin-user-doc -->
   * CMP Field sno
   *
   * Returns the sno
   * @return the sno
   * 
   * <!-- end-user-doc -->
   *
   * <!-- begin-xdoclet-definition --> 
   *
   * @ejb.persistent-field 
   * @ejb.persistence
   *    column-name="sno"
   *     jdbc-type="VARCHAR"
   *     sql-type="number"
   *     read-only="false"
   *  
   * @ejb.pk-field 
   * @ejb.interface-method
   * 
   * --
   * This is needed for JOnAS.
   * If you are not using JOnAS you can safely remove the tags below.
   * @jonas.cmp-field-jdbc-mapping  field-name="sno"
   * jdbc-field-name="sno"
   * 
   * --
   * <!-- end-xdoclet-definition --> 
   * @generated
   */
  public abstract java.lang.Integer getSno();  /**
   * <!-- begin-user-doc -->
   * Sets the sno
   * 
   * @param java.lang.Integer the new sno value
   * <!-- end-user-doc -->
   * 
   * <!-- begin-xdoclet-definition --> 
   * @ejb.interface-method
   * <!-- end-xdoclet-definition -->
   * @generated 
   */
  public abstract void setSno(java.lang.Integer sno);  /**
   *
   *
   * <!-- begin-user-doc -->
   * CMP Field cno
   *
   * Returns the cno
   * @return the cno
   * 
   * <!-- end-user-doc -->
   *
   * <!-- begin-xdoclet-definition --> 
   *
   * @ejb.persistent-field 
   * @ejb.persistence
   *    column-name="cno"
   *     jdbc-type="VARCHAR"
   *     sql-type="number"
   *     read-only="false"
   * @ejb.pk-field 
   *
   * @ejb.interface-method
   * 
   * --
   * This is needed for JOnAS.
   * If you are not using JOnAS you can safely remove the tags below.
   * @jonas.cmp-field-jdbc-mapping  field-name="cno"
   * jdbc-field-name="cno"
   * 
   * --
   * <!-- end-xdoclet-definition --> 
   * @generated
   */
  public abstract java.lang.Integer getCno();  /**
   * <!-- begin-user-doc -->
   * Sets the cno
   * 
   * @param java.lang.Integer the new cno value
   * <!-- end-user-doc -->
   * <!-- begin-xdoclet-definition --> 
   * @ejb.interface-method
   * <!-- end-xdoclet-definition -->
   * @generated 
   */
  public abstract void setCno(java.lang.Integer cno);楼主给分!