Usage Example

For example, suppose that there’s a view model that wraps a Customer and its Orders. For this view model the Customer represents the logical identity. This view model might therefore be implemented as follows:

@XmlRootElement("customerAndOrders")
@XmlAccessType(FIELD)
public class CustomerAndOrders implements HintStore.HintIdProvider {

    @Getter @Setter
    private Customer customer;

    // ...

    @Programmatic
    public String hintId() {
        bookmarkService.bookmarkFor(getCustomer()).toString();
    }

    @XmlTransient
    @Inject BookmarkService bookmarkService;
}