org.sormula.annotation.cascade
Annotation Type OneToOneCascade


@Retention(value=RUNTIME)
@Target(value=FIELD)
public @interface OneToOneCascade

Cascade annotation for a one to one relationship between source row and target row. Insert, update, and delete cascades default to standard primary key operations. Select cascade must be defined since SelectCascade.sourceParameterFieldNames() are not known by default. For more complex cascade relationships, use Cascade.

More than one operation is allowed per field even though it is not likely that you would need more than one. selects(), updates(), inserts(), and deletes() accepts arrays which allow an empty array to mean "do nothing".

Since:
1.0
Author:
Jeff Miller

Required Element Summary
 SelectCascade[] selects
          Select cascade operations that will select target rows.
 
Optional Element Summary
 DeleteCascade[] deletes
          The cascade operations to perform when source row is deleted.
 InsertCascade[] inserts
          The cascade operations to perform when source row is inserted.
 boolean readOnly
          Indicates if cascade should never modify the database.
 SaveCascade[] saves
          The cascade operations to perform when source row is saved.
 UpdateCascade[] updates
          The cascade operations to perform when source row is updated.
 

Element Detail

selects

public abstract SelectCascade[] selects
Select cascade operations that will select target rows. Typical values would be:

Returns:
select annotations for cascade; use empty array for no select cascade

readOnly

public abstract boolean readOnly
Indicates if cascade should never modify the database. An equivalent to using readOnly=true would be to set inserts={}, updates={}, and deletes={}.

Returns:
true to use only the select operations (never modify); false to cascade all operations
Default:
false

inserts

public abstract InsertCascade[] inserts
The cascade operations to perform when source row is inserted.

Returns:
insert annotations for cascade; use empty array for no insert cascade
Default:
@org.sormula.annotation.cascade.InsertCascade

updates

public abstract UpdateCascade[] updates
The cascade operations to perform when source row is updated.

Returns:
update annotations for cascade; use empty array for no update cascade
Default:
@org.sormula.annotation.cascade.UpdateCascade

saves

public abstract SaveCascade[] saves
The cascade operations to perform when source row is saved.

Returns:
save annotations for cascade; use empty array for no save cascade
Since:
1.9.3 and 2.3.3
Default:
@org.sormula.annotation.cascade.SaveCascade

deletes

public abstract DeleteCascade[] deletes
The cascade operations to perform when source row is deleted.

Returns:
delete annotations for cascade; use empty array for no delete cascade
Default:
@org.sormula.annotation.cascade.DeleteCascade