Book a Demo

Author Topic: Annotations and associations  (Read 2343 times)

korsbecker

  • EA Novice
  • *
  • Posts: 16
  • Karma: +0/-0
    • View Profile
Annotations and associations
« on: March 04, 2008, 05:33:16 pm »
Hi

I have a problem with adding annotations on setters for properties coming from associations also I have a problem with generation getters and setters coming from associations.

I have to classes A and B. A got one attribute a1 and I marked it "Property" which secures generation of getters and setters when I generate code and this is fine. Between A and B there is an association. When I generate code directly from the model no getters and setters are generated, it seems that I have to make a transformation in order to get the getters and setter???? Is there any other way of securing generation of getters and setters?

Anyway if the association between class A and B is a one-to-many I need to annotate the setter with the following:


  @OneToMany(
    cascade={CascadeType.ALL},
    fetch=FetchType.EAGER
  )

  @JoinColumn(name="[setter attribute]")

What is the easiest way of doing this?

Henrik :-)