IBM WebSphereTM eXtreme Scale, Release 8.6
API Specification

com.ibm.websphere.projector.annotations
Annotation Type OneToMany


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

Specifies a multi-valued association to another entity that has one-to-many multiplicity.

Since:
WAS XD 6.1

Optional Element Summary
 String alias
          The alternative name for this attribute.
 CascadeType[] cascade
          Specifies which operations must be cascaded to the target of the association.
 FetchType fetch
          Suggestion to the projector on how to retrieve the data for this association.
 String mappedBy
          The field that owns the relationship.
 Class targetEntity
          The target class of the association.
 

alias

public abstract String alias
The alternative name for this attribute. The alias can be used to map one entity to another or override the default property name behavior in legacy objects. It can also be used to refer to this attribute in queries.

Returns:
the alias name.
Default:
""

targetEntity

public abstract Class targetEntity
The target class of the association. Required only if the target class type cannot be inferred by the type of field or property that stores the association.

Returns:
the target class or void.class if not specified.
Default:
void.class

mappedBy

public abstract String mappedBy
The field that owns the relationship. The mappedBy element is only specified on the inverse (non-owning) side of the association. Required only when the owner of the relationship cannot be inferred.

Returns:
the field that owns the relationship.
Default:
""

cascade

public abstract CascadeType[] cascade
Specifies which operations must be cascaded to the target of the association. By default, no operations are cascaded.

Returns:
the operations to cascade.
Default:
{}

fetch

public abstract FetchType fetch
Suggestion to the projector on how to retrieve the data for this association.

The EAGER strategy instructs the projector to eagerly fetch the data. The LAZY strategy is a hint to the projector to lazily fetch the data when it is first accessed.

Returns:
the FetchType hint.
Default:
com.ibm.websphere.projector.annotations.FetchType.LAZY

IBM WebSphereTM eXtreme Scale, Release 8.6
API Specification

© Copyright International Business Machines Corp 2005,2012. All rights reserved.