org.compass.annotations
Annotation Type SearchableIdComponent


@Target(value={METHOD,FIELD})
@Retention(value=RUNTIME)
public @interface SearchableIdComponent

Specifies a searchable id component on property or field of the Searchable class.

A searchable id component is a class field/property that reference another class, which content need to be embedded into the content of its Searchable class and represents one of its ids.

The referenced class must have searchable definitions, defined either using annotations or other means (like xml).

Compass will try to automatically identify the searchable class mapping definitions that map to the component class. If the mappings can not be automatically identified, the refAlias() should be used to reference the alias that has the searchable class mapping definition.

The searchable component can annotate a Collection type field/property, supporting either List or Set. The searchable component will try and automatically identify the element type using generics, but if the collection is not defined with generics, refAlias() should be used to reference the component searchable class mapping definitions.

The searchable component can annotate an array as well, with the array element type used for referenced searchable class mapping definitions.

Author:
kimchy
See Also:
Searchable, SearchableReference

Optional Element Summary
 String accessor
          The property accessor that will be fetch and write the property value.
 Cascade[] cascade
          The operations that will cascade to the target association.
 String converter
          The conveter lookup name that will convert the ComponentMapping.
 int maxDepth
          The depth of cyclic component references allowed.
 boolean override
          Should the component definitions override an already existing component definitions for the same field/property.
 String prefix
          An optional prefix that will be appended to all the component referenced class mappings.
 String refAlias
          The reference alias that points to the searchable class (either defined using annotations or xml).
 

refAlias

public abstract String refAlias
The reference alias that points to the searchable class (either defined using annotations or xml). Not required since most of the times it can be automatically detected.

Default:
""

override

public abstract boolean override
Should the component definitions override an already existing component definitions for the same field/property.

Default:
true

cascade

public abstract Cascade[] cascade
The operations that will cascade to the target association. Defaults to no operations being cascaded.

Default:
{}

maxDepth

public abstract int maxDepth
The depth of cyclic component references allowed.

Default:
1

prefix

public abstract String prefix
An optional prefix that will be appended to all the component referenced class mappings.

Default:
""

converter

public abstract String converter
The conveter lookup name that will convert the ComponentMapping. Defaults to compass own intenral ComponentMappingConverter.

Default:
""

accessor

public abstract String accessor
The property accessor that will be fetch and write the property value.

It is automatically set based on where the annotation is used, but can be explicitly set. Compass also supports custom property accessors, registered under a custom name, which can then be used here as well.

Default:
""


Copyright (c) 2004-2008 The Compass Project.