facebook

Creating hbm.xml files from XDoclet tags

  1. MyEclipse Archived
  2.  > 
  3. Database Tools (DB Explorer, Hibernate, etc.)
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #229489 Reply

    I have already tried the example using the DB browser to creat a hibernat mapping from a table to a newly created java task. That is
    the opposite direction from

    What I really want to do is to generate both the hbm.xml and DDL
    from XDoclet marked up pojos. I run XDoclet but am not getting any
    generated hbm.xml files.

    For now, I’ll work on just using ANT to do what I want. Is there any way
    within the MyEclipse support to manually add a class to the hibernate.cfg.xml file and have XDoclet generate the corresponding
    hbm.xml file?

    #229491 Reply

    Riyad Kalla
    Member

    MyEclipse support to manually add a class to the hibernate.cfg.xml file and have XDoclet generate the corresponding
    hbm.xml file?

    There is not currently suppose for this direction of generation.

    #229497 Reply

    Ok, hibernate.cfg.xml has to be manually updated.

    I could use some help on configuring XDoclet to generate the hbm.xml files from my Java files.
    What properties need to be set in MyEclipse-XDoclet : Standard Hibernate : hibernatedoclet?

    #229503 Reply

    Riyad Kalla
    Member

    What properties need to be set in MyEclipse-XDoclet : Standard Hibernate : hibernatedoclet?

    Yes exactly, you want to enable the Hibernate doclet task, and then in your individual POJOs you want to mark up them up with standard XDoclet Hibernate tags, please see this for reference: http://xdoclet.sourceforge.net/xdoclet/tags/hibernate-tags.html

    I’m sorry if this is more vague then what you are looking for, while MyEclipse does support XDoclet and provides content assist for it, XDoclet is a huge beast, one of the MANY things it supports is Hibernate and I am not that versed with the XDoclet hibernate tags, I’ve only used them a few times.

    #229515 Reply

    The tags are not the issue. I know and understand them. The problem was getting XDoclet to do the right thing.

    I finally figured it out and thought I would write it up to create a path for someone else like myself.

    To configure XDoclet to generate hbm.xml files, go to:

    Project->Properties

    Select MyEclipse-XDoclet
    Click AddStandard and select Add the Standard Hibernate.
    Remove the hibernatdoclet->hibernate entry as it contains a lower case version vs. the expected Version.
    Add the hibernate entry and set the Version appropriately.
    Make sure that the hibernatedoclet destDir property is set to where the hbm.xml files should go.

    The one general comment about XDoclet and Hibernate is that if you do not see your POJO’s echoed during the build,
    then the hbm.xml files were not generated.

    Hope this helps.

    #229516 Reply

    Riyad Kalla
    Member

    I finally figured it out and thought I would write it up to create a path for someone else like myself.

    Thank you for posting your solution, I appologize for misunderstanding your request earlier.

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: Creating hbm.xml files from XDoclet tags

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