SPT Object Database API

com.sptci.prevayler.annotations
Annotation Type ForeignKey


@Documented
@Inherited
@Retention(value=RUNTIME)
@Target(value={TYPE,FIELD})
public @interface ForeignKey

Annotation used to indicate a foreign key (direct reference to another prevalent object). Foreign keys are automatically indexed, hence it is not necessary to declare single field indices for fields that are also marked as foreign keys. Delete actions are also configured using this annotation.

© Copyright 2008 Sans Pareil Technologies, Inc.

Version:
$Id: ForeignKey.java 11 2008-06-30 21:33:41Z sptrakesh $
Author:
Rakesh Vidyadharan 2008-05-23

Optional Element Summary
 String collectionEntry
          The fully qualified name of the prevalent object stored in collection fields.
 ForeignKey.DeleteAction deleteAction
          The action to perform when the referenced prevalent object is deleted from the prevalent system.
 String member
          The name of the field in the prevalent object.
 boolean unique
          Indicate whether the referenced prevalent object should be unique within the extent of the prevalent object being annotated.
 

member

public abstract String member
The name of the field in the prevalent object. This is necessary only when the prevalent class is annotated. Defaults to NULL.

Returns:
The name of the field that is a foreign key.
Default:
""

unique

public abstract boolean unique
Indicate whether the referenced prevalent object should be unique within the extent of the prevalent object being annotated. Defaults to false.

Returns:
Return true if the referenced prevalent object should be unique.
Default:
false

deleteAction

public abstract ForeignKey.DeleteAction deleteAction
The action to perform when the referenced prevalent object is deleted from the prevalent system. Defaults to ForeignKey.DeleteAction.EXCEPTION.

Returns:
The delete action to apply.
Default:
EXCEPTION

collectionEntry

public abstract String collectionEntry
The fully qualified name of the prevalent object stored in collection fields. This is necessary only for collection fields since it is difficult to infer the type of objects stored in them.

Returns:
The fully qualified class name stored in the collection.
Default:
""

SPT Object Database API