Package org.openxava.annotations
Annotation Type SearchKey
-
@Retention(RUNTIME) @Target({FIELD,METHOD}) public @interface SearchKeyA search key property or reference is used by the user to search.Applies to properties and references.
If the @
Idproperty is @Hiddenyou can useSearchKeyto indicate what property or reference will be used for searching.
By default, OpenXava allows to the user to search objects (in references for example) by the @Id property, if the @Id property is hidden then the first property of the view is used. In some case you want to choose what properties will be use for searching. @SearchKey is for that. Example:@Id @GeneratedValue(generator="system-uuid") @Hidden @GenericGenerator(name="system-uuid", strategy = "uuid") private String oid; @SearchKey @Column(length=4) @DefaultValueCalculator(CurrentYearCalculator.class) private int year; @SearchKey @Column(length=6) private int number;In this caseoidis a hidden id, and the user will be useyearandnumberfor searching the objects in references. The propertiesyearandnumberare search keys.- Author:
- Javier Paniza