facebook

JBOSS 3.2.4 – EJB Autoincrement

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #208486 Reply

    mventre
    Member

    System Setup ——————————-
    Operating System and version: XP
    Eclipse version:
    Eclipse build id:
    Fresh Eclipse install (y/n): y
    If not, was it upgraded to its current version using the update manager?
    Other installed external plugins: no
    Number of plugins in the <eclipse>/plugins directory that begin with org.eclipse.pde.*:
    MyEclipse version: 3.0RC1
    Eclipse JDK version:
    Application Server JDK version: Jboss 3-2-4RC2
    Are there any exceptions in the Eclipse log file?

    – Message Body ——————————-

    Hi folks
    i know that this issue has been reviewed a lot of time but i m too confusing what is the right way to implement the auto-increment key using JBOSS 3.2.4 with Xdoclet supported by MyEclipse.
    I saw on the www a lot of chunk code example that say everything works on this way …bal bla bla but i was not capable to implement that.

    I need someone to confirm me if what i learned about auto-increment is right or not:

    a) in the ejb-jar i must insert
    * @–jboss.unknown-pk class=”java.lang.Object”
    * auto-increment=”true”
    * column-name = “IDUtenti”
    * jdbc-type=”INTEGER”
    * sql-type=”int”
    * @–jboss.entity-command name=”mysql-get-generated-keys”

    b) i must not implement the getIDutenti …and setIDUtenti cmp method
    c) i must not declare in class definition
    @ejb.bean name = “Utenti” the primary-field=”IDUtenti” << NOT!!
    d) the IDUtenti column in the database must be created with auto-increment option
    e) cross your finger and pray

    ..anyway i did that but the only result i get is “The primary key field is null”. do u have some full example i can try to check if this things works?

    thanx

    #208498 Reply

    Riyad Kalla
    Member

    I will ask our XDoclet guru to look at this.

    #208575 Reply

    Greg
    Member

    Try putting the following xdoclet tag on your primary key field.

    *
    * @jboss.persistence
    *       auto-increment="true"
    *
    */
Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: JBOSS 3.2.4 – EJB Autoincrement

You must be logged in to post in the forum log in