facebook

XDoclet / Hibernate problem [Closed]

  1. MyEclipse Archived
  2.  > 
  3. Bugs
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #197179 Reply

    lwerner
    Member

    Hi,

    I think I just found a problem in MyEclipseIDE’s XDoclet support. I’m trying to use the <hibernate> doclet to generate Hibernate ORM mappings for some of my model classes. I eventually figured out how to add doclet processing to my build: go to Project -> Properties -> XDoclet Configurations; right-click in the upper pane, choose Add Standard, then Standard Hibernate. (You really need to document this. As my boss always tells me: If it’s not documented it doesn’t exist.)

    The problem is that I’m using Hibernate 2.0. The <hibernate> doclet needs a version=”2.0″ attribute to tell it to generate the 2.0 syntax and add the 2.0 DTD to the output files. To try to fix this, I clicked on “hibernatedoclet” in the lower-left pane, then on “hibernate”. Yes! There’s a Version property, so I set it to “2.0”. Unfortunately, this generates:

    <hibernate Version="2.0" >

    with an upper-case V, which is wrong.

    So, I’ve got two requests:

    • Please add this to the bug list. It should be easy to fix. 🙂
    • Does anyone know what config file I can edit to work around this in the meantime? I poked around in …/plugins\org.jboss.ide.eclipse.xdoclet.core_2.5.0 and in the hibernate-module jar in that directory, but I couldn’t find the place where this is defined. Any hints would be appreciated.

    BTW, I noticed that all of the XDoclet jars are version “1.2b4”. But on the XDoclet site, there is no 1.2b4; it seems they’re going straight from 1.2b3 to 1.2 final. Is this an interim build? Is there any way I can tell what (if any) bug fixes have been made to it since 1.2b3?

    Thanks!

    — Laura[/list]

    #197182 Reply

    Scott Anderson
    Participant

    Laura,

    Thanks for your interest in MyEclipse.

    You really need to document this. As my boss always tells me: If it’s not documented it doesn’t exist.)

    Please see Help -> Help Contents -> MyEclipse User Guide -> Getting Started… -> XDoclet Overview. For more detailed XDoclet documentation you can then see Reference -> XDoclet. The documentation may not be perfect, but I believe the information you needed is there for the reading. 🙂

    As far as any bugs in the actual XDoclets go, they should really be posted to the XDoclet project site at http://xdoclet.sourceforge.net. If you’d like to upgrade your doclets, information on how to do this is provided in the XDoclet overview. If a newer version of the Hibernate module exists on the XDoclet site you should be able to replace the one in MyEclipse and hit refresh, as shown in the Overview.

    Please let us know what you find.

    –Scott
    MyEclipse Support

    #197184 Reply

    lwerner
    Member

    Hi Scott,

    I guess my post wasn’t clear. The Hibernate XDoclet works fine when I run it from Ant. I put <hibernate version=”2.0″> into my build.xml, and the doclet generates the correct 2.0 syntax. This is with XDoclet 1.2b3 from 6/12/2003. (Oddly, though, the jars in xdoclet 1.2b3’s lib directory are all named *-1.2b4.jar. Now I understand why the ones in MyEclipse are named that way.)

    The problem is with the Hibernate XDoclet UI in MyEclipse. When I go to the XDoclet configuration under Project -> Properties and then navigate to the properties for <hibernate>, it lists all the right attributes, except that “version” is incorrectly uppercased as “Version”. When the Eclipse XDoclet Run thingy generates an xml file, it puts in <hibernate Version=”2.0″>, which doesn’t work.

    I just verified that this still happens after replacing the xdoclet-hibernate-module-1.2b4.jar in MyEclipse with the one from the XDoclet distribution, following the instructions in the MyEclipse help. I can’t figure out where the UI is getting “Version” from; it doesn’t seem to be in any of the config files I can find inside the xdoclet-hibernate-module jar.

    I found the documentation now that you pointed it out. I’d actually found the “XDoclet Overview” section before, but I was being dense and not clicking on the + sign to expand it and see the subtopics. Is there any way to make the bolded subtopic names on that Overview page be links to the subtopics in case anyone else is as spaced out as I was?

    Thanks!

    — Laura

    #197188 Reply

    Scott Anderson
    Participant

    Laura,

    The problem is with the Hibernate XDoclet UI in MyEclipse. When I go to the XDoclet configuration under Project -> Properties and then navigate to the properties for <hibernate>, it lists all the right attributes, except that “version” is incorrectly uppercased as “Version”. When the Eclipse XDoclet Run thingy generates an xml file, it puts in <hibernate Version=”2.0″>, which doesn’t work.

    I looked into this briefly and couldn’t see why the version was being listed as uppercase either. I’ve entered it into our internal defect tracking system so that the problem can be investigated further. I really have no idea where this could be happening, because I assure you we have no hardcoded values for any of the doclets in the code; all the listing is done by introspection. Weird.

    Is there any way to make the bolded subtopic names on that Overview page be links to the subtopics in case anyone else is as spaced out as I was?

    I’ll ask the doc guys if anything can be done, but I have a feeling that this is just how the help system works.

    –Scott
    MyEclipse Support

    #197341 Reply

    Scott Anderson
    Participant

    Laura,

    I haven’t forgotten about the Hibernate problem.

    I did some more reseach and found that the Hibernate configuration is defined in two xml files that are stored in the MyEclipse installation in the org.jboss.ide.eclipse.xdoclet.run plugin. The files are standards.xml and reference.xml. If you open them up you’ll see the hibernate declarations. Try changing the version tag to lowercase and see if this addresses the problem. If it does, I’ll make sure the fix gets into the next release.

    –Scott
    MyEclipse Support

    #197346 Reply

    lwerner
    Member

    Hi Scott,

    That worked. Thanks for tracking it down! After editing the configuration files, I also had to go into Project->Properties->XDoclet Configuration and remove then re-add the “Standard Hibernate” configuration, which was no big deal.

    For the record, the changes I made were:

    • Under the <hibernate> element in standards.xml, change the “Version” attribute to “version”.
    • Ditto for the <hibernate> element in reference.xml.

    — Laura

    #197352 Reply

    Scott Anderson
    Participant

    Laura,

    Thanks for trying it out. I’ll make sure the changes make it into the next service release.

    –Scott
    MyEclipse Support

Viewing 7 posts - 1 through 7 (of 7 total)
Reply To: XDoclet / Hibernate problem [Closed]

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