Skip to content
Bob Vawter edited this page Jun 25, 2012 · 1 revision

Annotations Used by FlatPack

Security

  • @PermitAll, @DenyAll, @RolesAllowed may be placed on property getters and setters to restrict access to those property by user role. This is used in combination with a RoleMapper.
  • @InheritPrincipal may be applied to a property getter to indicate that if the current user Principal may edit the referred object, it may also edit the referring object. This is used in combination with a PrincipalMapper.

Entity Modeling

  • @Embedded is recognized and will cause the properties of the embedded value to be emitted in-line with the properties of the containing object.
  • @OneToMany and @ManyToOne are recognized and will cause the Unpacker to keep both sides of a relationship in sync if a payload specifies a value for only one relatonship. For example, if a merchantLocation.merchantUuid value is in the payload, the associated merchant.merchantLocationsUuid property will be implicitly updated.

Payload Tweaks

  • @JsonProperty may be applied to getters to alter the encoded property name.
  • @JsonTypeName overrides the entity type name mapping.
  • @SuppressDefaultValue prevents false or 0-valued properties from being emitted.

Control

  • @PreUnpack and @PostUnpack may be applied to a no-arg method in an entity type to be called during the unpacking process.

Clone this wiki locally