wood burning stoves 2.0*
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 Android Security Essentials Live Lessons this week in the Android 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="http://www.laliluna.de" target="_blank" rel="nofollow">www.laliluna.de</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: http://aspose.com/file-tools
subject: Hibernate/XDoclet changing name attribute to role
Similar Threads
Integrity constraint violation: for Hibernate Insert
Hibernate XDoclet Set Refresh
Error when saving relationship
Help with mapping strange table
hibernate problem, what to try next?