JPA Annotation Attributes

How can I generate JPA annotations with its attributes, like “uniqueConstraints”, “cascade”, “AttributeOverride” and “AssociationOverride” ?

Folowing an example of its application:

@Table(name=“SBSARH2”, uniqueConstraints={@UniqueConstraint(columnNames={“SBSARH201”,“SBSARH203”}),
@UniqueConstraint(columnNames={“SBSARH201”,“SBSARH237”}), @UniqueConstraint(columnNames={“SBSARH201”,“SBSARH221”})})
public class Pessoa implements Serializable {

  ...

}

@ManyToOne(cascade={CascadeType.MERGE, CascadeType.PERSIST})
@JoinColumn(name=“SBSARH3TM1”)
private LancamentoAutomaticoGeral lancamentoAutomatico;

Thanks

Hi Ruben Lins,

Thanks for your post. You can add Java annotation under “Java Annotation” tab of Specification dialog of attribute. Hope this helps. Feel free to have another post if there is any further inquiry.

Best regards,
Lilian Wong
add_java_annotation.png

Hi LilianWong

Thanks for your reply. I can add annotations into model elements, but the code generated by “java round trip” feature doesn’t include the annotation’s properties. It’s possible to generate code with annotation’s properties ?

Grateful for your atention,

Ruben Lins

Hi Ruben Lins,

Thanks for replying. I’m sorry that Java annotation is not handled in Java round-trip engineering, but we will support it in VP Suite 4.2 (planned to be released on January 2010).

Best regards,
Lilian Wong

Hi Ruben Lins,

We deployed released candidate (RC) of VP Suite 4.2, and I sent you a private message about the RC so you can try the annotation support. Please have a check in your message box. :slight_smile:

Best regards,
Lilian Wong