That are good points.
In fact, now that you tell it, I remember to have read the object things and am now 
wondering, why this works. Well, it does. Even though the ejbCreate is Integer. 
Strange...

I had an error, with not declaring a pk-field, or having a pk-field declared, which is 
no cmp-field. JBoss didn't like that. 

Is my working version more of a bug?
Here's my EmployeeBean.java

  | /**
  |  * The Employee Entity Bean handles the information of an employee.
  |  * @author Karsten Jahn (OrangeOak)
  |  * @version 1.0
  |  *
  |  * @ejb.bean
  |  *          name = "Employee"
  |  *          display-name = "EB_DataBase - Employee: Employee"
  |  *          description = "The Employee Entity Bean saves every Employee."
  |  *          view-type = "local"
  |  *          type = "CMP"
  |  *          cmp-version = "2.x"
  |  *          local-jndi-name = "ejb/medsched/employee/Employee"
  |  *          reentrant = "false"
  |  *          primkey-field = "employeeID"
  |  * 
  |  * @ejb.pk class = "java.lang.Object"
  |  *          
  |  * @jboss.persistence
  |  *          create-table = "true"
  |  *          remove-table = "false"
  |  *          datasource = "java:/mySQLDS"
  |  *          datasource-mapping = "mySQL"
  |  *          table-name = "employee"
  |  * 
  |  * @jboss.unknown-pk 
  |  *          class = "java.lang.Integer"
  |  *          auto-increment = "true"
  |  *          column-name = "employeeid"
  |  *          sql-type = "INTEGER"
  |  *          jdbc-type = "INTEGER"
  |  *          
  |  * @jboss.entity-command name = "mysql-get-generated-keys"
  |  */
  | public abstract class EmployeeBean implements EntityBean {
  | 
  |     /**
  |      * @ejb.interface-method view-type = "local"
  |      * @ejb.persistence column-name = "employeeid"
  |      * @ejb.pk-field
  |      * @jboss.persistence 
  |      *              auto-increment = "true"
  |      *              not-null = "true"
  |      */
  |     public abstract Integer getEmployeeID();
  |     public abstract void setEmployeeID(Integer employeeID);
  | 
  | [...]
  |     
  |     /**
  |      * @throws CreateException
  |      * @ejb.create-method
  |      */
  |     public Integer ejbCreate(StaffMember employee) throws CreateException {
  |             setLastname(employee.lastname);
  |             setFirstname(employee.firstname);
  |             setTelephone(employee.telephone);
  |             return null;
  |     }
  |     public void ejbPostCreate(StaffMember employee) {
  |     }
  | }
  | 

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3830265#3830265

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3830265


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to