Annotation Interface BelongTo


@Target(FIELD) @Retention(RUNTIME) public @interface BelongTo

Annotation used to indicate that a field represents a relationship of belonging to another class. This annotation is typically used by our frameworks to define the relationship between two classes for purpose of automating the creation of web services. The default value is true, meaning that the field belongs to the other class.

Example usage:


 // The User class belongs to the Role class
 public class User {
     ...
     @BelongTo
     private Role role;
     ...
 }
 // The Role class has many Users
 public class Role {
     ...
     @HasMany
     private List<User> users;
     ...
 }
 
See Also:
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    Indicates whether the annotated field belongs to the other class (true) or not (false).
  • Element Details

    • value

      boolean value
      Indicates whether the annotated field belongs to the other class (true) or not (false). The default value is true.
      Default:
      true