Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
EclipseLink/Development/AdditionalCriteria
Additional Criteria Requirements and Design
Enhancement Request: bug 322008
Sample Usage
The following is an initial proposal to generate discussion.
@Entity // This annotation is needed and very useful when defining comparison against // columns that are not mapped @BasicQueryAttribute(name = "isDeleted", column = @Column(name = "IS_DEL")) /** * Simple fixed criteria for virtual delete scenario */ @FixedCriteria(attribute = "isDeleted", operator = EQUAL, value = "Y") /** * Simple Property usage. The property will be looked up in the active session * * Note: Currently this is only the UOW/CS when the cache.shared=false. When cache.shared=true only the server session's properties are visible. */ @PropertyCriteria(attribute = "company", operator = LIKE, property = "COMPANY_PATTERN") /** * Call-back criteria where expressions can be added dynamically. This class * could either implement an interface for call-backs or an additional set of * annotations could be defined that allows you to define which methods are * called for which query types. */ @CallbackCriteria(CustomerUserCriteria.class) /** * More complex additional criteria that supports composition, named access, and * enable/disable. Any of the above could be specified within @AdditionalCriteria to * allow enable/disable through named access. * * When specified without @AdditionalCriteria all of the provided criteria are combined * into a AdditionalCriteria named 'default' on the descriptor and enabled. */ @AdditionalCriteria(name = "example", enabled = false, fixed = { @FixedCriteria(attribute = "name", operator = NOT_NULL) }, properties = { @PropertyCriteria(attribute = "company", operator = EQUAL, property = "COMPANY_NAME") }, callbacks = { @CallbackCriteria(CustomerTemporalCriteria.class) }) public class Customer { @Id private int id; private String name; private String company;