• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

XDoclet: generating a many-to-one mapping in hibernate with access="field"

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm attempting to generate a many-to-one relation in hibernate with access="field". There are no getter/setter methods for this property. When I generate the mapping, my many-to-one does not get included. How do I cause this to be included in the generated mapping?
Thanks, Mike Monette
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Suppose u want to create a relationship to another class called XXX with column name XXX_column
< !-- bi-directional many-to-one association to XXX -->

<many-to-one<br /> <br /> name="XXX"<br /> <br /> class=" XXX "<br /> <br /> not-null="true"<br /> <br /> >

<meta attribute="field-description">

@hibernate.many-to-one

not-null="true"

@hibernate.column name="XXX_column"

</meta>

<column name="XXX_column" />

</many-to-one>

Hope this helps
 
Aravind Sathiyanarayanan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Suppose u want to create a relationship to another class called XXX with column name XXX_column
< !-- bi-directional many-to-one association to XXX -->

<many-to-one<br /> <br /> name="XXX"<br /> <br /> class=" XXX "<br /> <br /> not-null="true"<br /> <br /> >
<meta attribute="field-description">

@hibernate.many-to-one

not-null="true"

@hibernate.column name="XXX_column"

</meta>

<column name="XXX_column" />

</many-to-one>

Hope this helps
 
Mike Monette
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe I wasn't being clear in my first post. The problem is not generating the relationship in general, but in getting xdoclet to generate it when there is no getXXX method, and wanting to specify access="field" in the hibernate mapping (because there is no getXXX method).

Thanks
Mike Monette
 
Evacuate the building! Here, take this tiny ad with you:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic