return type of ejbCreate

Discussions

EJB design: return type of ejbCreate

  1. return type of ejbCreate (3 messages)

    Hi there,

    Can I define an ejbCreate that the return type is other than the type of primary key?

    Thanks and regards,
    Lijun

    Threaded Messages (3)

  2. return type of ejbCreate[ Go to top ]



           Hi,

    I think we can't write

         Satya
  3. return type of ejbCreate[ Go to top ]

    Why would you want to return anything other than the primary key?

    James
  4. return type of ejbCreate[ Go to top ]

    Yes, you can. You need not define a custom primary key class, you can just use appropriate wrapper classes. For example, String, Byte, Boolean, Integer, etc. you can also use StringBuffer, Date, Hashtable ... You can use any class as long as it's serializable. For example if you String as return type in ejbCreate, you need not have your custom Primary key class.
    You can specify in your dd like this
    <prim-key-class>java.lang.String</prim-key-class>
    <prim-key-field>somefield</prim-key-field>

    Hope this helps you