public class InverseManager extends Object implements Configurable
Modifier and Type | Field and Description |
---|---|
protected DataCacheManager |
_mgr |
static int |
ACTION_EXCEPTION
Constant representing the
ACTION_EXCEPTION action |
static int |
ACTION_MANAGE
Constant representing the
ACTION_MANAGE action |
static int |
ACTION_WARN
Constant representing the
ACTION_WARN action |
protected static Object |
NONE |
Constructor and Description |
---|
InverseManager() |
Modifier and Type | Method and Description |
---|---|
protected void |
addToCollection(OpenJPAStateManager sm,
FieldMetaData fmd,
Object val)
Add the given value to the collection at the selected field.
|
protected void |
clearInverseRelations(OpenJPAStateManager sm,
FieldMetaData fmd,
FieldMetaData[] inverses,
Object newValue)
Remove all relations between the initial value of
fmd for
the instance managed by sm and its inverses. |
protected void |
clearInverseRelations(OpenJPAStateManager sm,
Object val,
FieldMetaData fmd,
FieldMetaData[] inverses)
Clear all inverse the relations from
val to the instance
managed by sm . |
void |
correctRelations(OpenJPAStateManager sm,
FieldMetaData fmd,
Object value)
Correct relations from the given dirty field to inverse instances.
|
protected void |
createInverseRelations(StoreContext ctx,
Object fromRef,
Object toRef,
FieldMetaData fmd,
FieldMetaData[] inverses)
Create the inverse relations for all the given inverse fields.
|
void |
endConfiguration()
Invoked upon completion of bean property configuration for this object.
|
int |
getAction()
Return the action constant to use during relationship checking.
|
boolean |
getManageLRS()
Return whether to manage LRS fields.
|
protected void |
removeFromCollection(OpenJPAStateManager sm,
FieldMetaData fmd,
Object val)
Remove the given instance from the collection.
|
void |
setAction(int action)
Set the action constant to use during relationship checking.
|
void |
setAction(String action)
Set the action string to use during relationship checking.
|
void |
setConfiguration(Configuration conf)
Invoked prior to setting bean properties.
|
void |
setManageLRS(boolean manage)
Set whether to false LRS relations.
|
void |
startConfiguration()
Invoked before bean property configuration is begun on this object.
|
protected void |
storeField(OpenJPAStateManager sm,
FieldMetaData fmd,
Object compare,
Object val)
Store a given value at the given field.
|
protected void |
storeNull(OpenJPAStateManager sm,
FieldMetaData fmd,
Object compare)
Store null value at the given field.
|
protected void |
throwException(OpenJPAStateManager sm,
FieldMetaData fmd)
Throw an inconsistency exception
|
protected void |
warnConsistency(OpenJPAStateManager sm,
FieldMetaData fmd)
Log an inconsistency warning
|
protected static final Object NONE
protected DataCacheManager _mgr
public static final int ACTION_MANAGE
ACTION_MANAGE
actionpublic static final int ACTION_WARN
ACTION_WARN
actionpublic static final int ACTION_EXCEPTION
ACTION_EXCEPTION
actionpublic boolean getManageLRS()
public void setManageLRS(boolean manage)
public int getAction()
ACTION_MANAGE
.public void setAction(int action)
ACTION_MANAGE
.public void setAction(String action)
manage, exception, warn
.
This method is primarily for string-based automated configuration.public void startConfiguration()
Configurable
startConfiguration
in interface Configurable
public void endConfiguration()
Configurable
endConfiguration
in interface Configurable
public void setConfiguration(Configuration conf)
Configurable
setConfiguration
in interface Configurable
public void correctRelations(OpenJPAStateManager sm, FieldMetaData fmd, Object value)
fmd
of the instance managed by sm
has
value value
. Ensure that all inverses relations from
value
are consistent with this.protected void createInverseRelations(StoreContext ctx, Object fromRef, Object toRef, FieldMetaData fmd, FieldMetaData[] inverses)
fromRef
to toRef
; this
method creates the inverses.protected void clearInverseRelations(OpenJPAStateManager sm, FieldMetaData fmd, FieldMetaData[] inverses, Object newValue)
fmd
for
the instance managed by sm
and its inverses. Relations
shared with newValue
can be left intact.protected void clearInverseRelations(OpenJPAStateManager sm, Object val, FieldMetaData fmd, FieldMetaData[] inverses)
val
to the instance
managed by sm
.protected void storeNull(OpenJPAStateManager sm, FieldMetaData fmd, Object compare)
protected void storeField(OpenJPAStateManager sm, FieldMetaData fmd, Object compare, Object val)
protected void removeFromCollection(OpenJPAStateManager sm, FieldMetaData fmd, Object val)
protected void addToCollection(OpenJPAStateManager sm, FieldMetaData fmd, Object val)
protected void warnConsistency(OpenJPAStateManager sm, FieldMetaData fmd)
protected void throwException(OpenJPAStateManager sm, FieldMetaData fmd)
Copyright © 2006–2020 Apache Software Foundation. All rights reserved.