In Active Objects a one to one relationship is defined thanks to the
In the DogFood blog there is such a relationship defined between the
Blog and its
And here is how this is defined in the
Then setting the relation ship is as simple as:
New attributes on entity annotations in Active Objects 0.22.1
The OneToOne, OneToMany and ManyToMany annotations are used to define relationships in Active Objects. If you have used one of these to annotate a method as one end of a relationship, you can now set an attribute(s) that specifies the method on the remote end of the relationship. In versions prior to 0.22.1, Active Objects would attempt to infer the method by the type, which did not work in all situations.
- OneToOne and OneToMany annotations: New "reverse" attribute. Set this to the name of the corresponding getter on the remote interface.
If you do not set these attributes, Active Objects will revert to inferring the method by type. However, in a future upgrade, specifying these attributes will be required.
Note, the Active Objects plugin was upgraded to 0.22.1 in JIRA 6.1.