Hiding Collections

Collections can be hidden at the domain-level, indicating that they are not visible to the end-user. This is accomplished using the hidden element.

The acceptable values are:

  • Where.EVERYWHERE or Where.ANYWHERE

    The collection should be hidden everywhere.

  • Where.ANYWHERE

    Synonym for everywhere.

  • Where.OBJECT_FORMS

    The collection should be hidden when displayed within an object form.

  • Where.NOWHERE

    The collection should not be hidden.

The other values of the Where enum have no meaning for a collection.

For example:

import lombok.Getter;
import lombok.Setter;

public class Customer {

    @Collection(where=Where.EVERYWHERE)
    @Getter @Setter
    private SortedSet<Address> addresses = ...

}

Alternatives

It is also possible to use @CollectionLayout#hidden or using file-based layout such that the collection can be hidden at the view layer.