@Retention(value=RUNTIME)
@Target(value={FIELD,ANNOTATION_TYPE})
public @interface SelectCascade
OneToOneCascade
, OneToManyCascade
, or Cascade
annotation
to define a cascade select operation.Modifier and Type | Optional Element and Description |
---|---|
boolean |
lazy
Marks a select cascade to be performed some later time after source row is selected.
|
java.lang.Class<? extends ScalarSelectOperation> |
operation
Specifics operation to perform as a select cascade.
|
boolean |
post
Specifies when the cascade is to occur.
|
boolean |
setForeignKeyReference
Indicates that foreign key reference should be set on target (child) rows during cascade.
|
boolean |
setForeignKeyValues
Indicates that foreign key values should be set on target (child) rows during cascade.
|
java.lang.String[] |
sourceParameterFieldNames
Specifies fields from source row to be used as parameters in cascade
operation for target row.
|
java.lang.String |
targetKeyMethodName
Method name in target class that returns row key value for adding to map
results.
|
java.lang.String |
targetOrderByName
Specifies the order condition to use in cascade.
|
java.lang.String |
targetWhereName
Specifies the where condition to use in cascade.
|
public abstract java.lang.Class<? extends ScalarSelectOperation> operation
ScalarSelectOperation
, ArrayListSelectOperation
, HashMapSelectOperation
or some subclass of those.
The default value of ArrayListSelectOperation
works correctly for source fields that
are scalar or List
. If the source field is not scalar or List
, then some other
select operation must be used.
public abstract java.lang.String[] sourceParameterFieldNames
targetWhereName()
or in same order
as primary key fields of target row if primary key is used as where condition.
"#primaryKeyFields" means source parameter fields are source primary key fields
"#targetFieldNames" means source parameter field names are the same names as defined by targetWhereName()
.
Any name that begins with dollar($) symbol indicates a named parameter. For example, $somename value is
obtained with SqlOperation.getParameter(String)
with a key of "somename". Named parameters set
at the top level operation of a cascading relationship are available at all levels of the cascade.
targetWhereName()
.public abstract java.lang.String targetWhereName
Where.name()
or "primaryKey"
for primary key. An empty string indicates no where condition (select all).
Typically is the name of the where condition that uses foreign key(s) in
target row that correspond to primary key(s) in source row.
"#sourceFieldNames" means use a where condition that uses fields defined by
sourceParameterFieldNames()
. If more than one field, then AND operand is used to
combine them. Name target foreign key fields the same as source field to use this symbolic name.
"#foreignKeyValueFields" means to use a where condition with fields defined by
OneToOneCascade.foreignKeyValueFields()
, or OneToManyCascade.foreignKeyValueFields()
,
or Cascade.foreignKeyValueFields()
. If more than one field, then AND operand is used to
combine them.
sourceParameterFieldNames()
;
"#foreignKeyValueFields" to select by target foreign key value fieldspublic abstract java.lang.String targetOrderByName
OrderBy.name()
or empty string for
unordered.public abstract boolean post
lazy()
is true.public abstract boolean setForeignKeyValues
Cascade.foreignKeyValueFields()
,
OneToManyCascade.foreignKeyValueFields()
, or OneToOneCascade.foreignKeyValueFields()
.
Foreign key values are set prior to cascade for insert, update, delete, and save cascades. They are set after select cascades.
public abstract boolean setForeignKeyReference
Cascade.foreignKeyReferenceField()
,
OneToManyCascade.foreignKeyReferenceField()
, or OneToOneCascade.foreignKeyReferenceField()
.
Foreign key reference is set prior to cascade for insert, update, delete, and save cascades. It is set after select cascades.
public abstract java.lang.String targetKeyMethodName
operation()
is instance of
MapSelectOperation
; otherwise it is ignored.
The method used for target key is likely the primary key for the row but may be some other method if select cascade produces a subset of rows.
"#primaryKey" to use target primary key method (works only with single primary key).
public abstract boolean lazy
LazySelectable.checkLazySelects(String)
is invoked
or when ActiveRecord.checkLazySelects(String)
is invoked.AbstractLazySelector
,
SimpleLazySelector
,
DurableLazySelector