File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Object Relational Mapping and the fly likes Hibernate/XDoclet changing name attribute to role Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernate/XDoclet changing name attribute to role" Watch "Hibernate/XDoclet changing name attribute to role" New topic

Hibernate/XDoclet changing name attribute to role

Mark Spritzler

Joined: Feb 05, 2001
Posts: 17249

Has anyone ever come across an issue where XDoclet generates the Hibernate mapping of a "bag" and changes the attribute "name" to show up in the mapping file as "role" instead. For some reason, we have one class that this happens to, and therefore when you deploy it, it fails because the mandatory name attribute is not there.

Here is the method and XDoclet code for this List



Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Sebastian Hennebrueder
Ranch Hand

Joined: Sep 09, 2004
Posts: 49
Hello Mark,

I have seen this one but I do not remember what we did. I am not a great fan of XDoclet even I have to use it for EJB 2. I prefer xml in java 1.4 and annotations in java 1.5 alias 5


Things get always more complicated as expected.<br />Author of eBook Hibernate 3 Developer Guide by example<br />Tutorials about Hibernate, EJB, Struts, JSF <a href="" target="_blank" rel="nofollow"></a>
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17249

Thanks Sebastian.

Here is what happened. The person that created this copied and pasted stuff form another module and didn't do it correctly. Such that it used the wrong Hibernate jar. It used the 2.1 jar and not the 3.0 jar. And the Maven Project.xml didn't have things correct either. So it used a different older version where the tag was supposed to be "role". We have now changed everything to be correct versions and such and it works.

I agree. Here's the link:
subject: Hibernate/XDoclet changing name attribute to role
Similar Threads
hibernate problem, what to try next?
Help with mapping strange table
Error when saving relationship
Hibernate XDoclet Set Refresh
Integrity constraint violation: for Hibernate Insert