facebook

XDoclet generation of primary key classes for JBoss

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

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

    richard.b
    Member

    Hi,

    Specs:
    Mandrake Linux 9.2, with 2.6.3 kernel.
    Eclipse 2.1.2 Build 200311030802
    – Fresh install
    – No other external plugins
    – 6 org.eclipse.pde.* plugins and 1 org.eclipse.pde_* plugin.
    MyEclipse 2.7.0 Build 200402281200-2.7.0-GA
    IBM Java 1.4.1 for both Eclipse and JBoss 3.2.3 application server

    Problem:
    Generating primary key classes fails when running XDoclet over an EJB module when the primkey-field parameter is added to the @ejb.bean tag – or I’m doing something wrong…

    I seem to have found that adding the primkey-field parameter to the @ejb.bean tag causes the <entitypk/> task to not generate any classes. Until it is added, all seems well and classes are generated. Unfortunately, JBoss requires this parameter to be present to generate correct SQL to create tables and deploy correctly (the parameter is spec, according to XDoclet website). The workaround of removing the parameter, running XDoclet, re-inserting the parameter and running XDoclet again doesn’t scale too well…

    However, it’s getting late (early now?) so if I’m doing something patently silly here, please let me know.

    Thanks,
    Richard.

    #204490

    nosrema
    Member

    Richard,

    From my limited understanding of ejb-related xdoclet, I think you only need to generate a primary key class if you are using more than two fields to define your primary key. Is this the case for your EJB?

    Since you are using the @ejb.bean primkey-field that implies you only have one field for a primary key, thus you wouldn’t need the generated primary key class. That may be (i’m speculating here) why xdoclet isn’t generating the primary key class when you add the primkey-field under @ejb.bean.

    #204979

    richard.b
    Member

    Just to confirm that was the problem. A little confusing for a J2EE newbie like myself though, but thanks for the pointer. It would be nice if XDoclet or MyEclipse could flag usage errors such as this. Unseen typos in the @ tags have caused me hours of pain too, with XDoclet silently ignoring them. If MyEclipse could keep a libary of JavaDoc and XDoclet tags, and flag unknown ones, that would be awesome. 🙂

    #204988

    Riyad Kalla
    Member

    Richard, this is a very good suggestion, I’ll pass it on.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: XDoclet generation of primary key classes for JBoss

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