public class RowReference extends ComponentObjectImpl implements DefPersistable, DiffMergeable
NAME RowReference.java - Base class for view object bases. DESCRIPTION NOTES VERSION MODIFIED (MM/DD/YY)
Modifier and Type | Field and Description |
---|---|
static byte |
EFFDT_USAGE_HAS_IMPLICIT_ATTRS |
static java.lang.String |
EFFDT_USAGE_HAS_IMPLICIT_ATTRS_STR |
static byte |
EFFDT_USAGE_NO_OVERRIDE |
static byte |
EFFDT_USAGE_OVERRIDE_FALSE |
static java.lang.String |
EFFDT_USAGE_OVERRIDE_FALSE_STR |
mFullName, mObjName, mParent, mProperties, RES_ID_SUFFIX, RESID_SUFFIX
FLAG_DIRTY, FLAG_EDITABLE, FLAG_FROM_TIP, FLAG_LOAD_BASE, FLAG_LOAD_HL_DEFS, FLAG_MAJOR_VERSION_CHANGED, FLAG_MINOR_VERSION_CHANGED, FLAG_NEW, FLAG_NEW_RECURSE, FLAG_SKIP_WRITE, XML_STATEMENT
DEFINITION_STATE_ACTIVE, DEFINITION_STATE_DEPRECATED, PROPERTY_DEFINITION_STATE, PROPERTY_ERROR_MSG, PROPERTY_LABEL, PROPERTY_LABEL_PLURAL, PROPERTY_TOOLTIP
Modifier and Type | Method and Description |
---|---|
void |
applyDiffChildren(DifferDetails dif,
DiffResolver resolver)
Applies changes to children defs.
|
void |
applyDiffContents(DifferDetails dif,
DiffResolver resolver)
When diff/merge operation is requested, we have the following
three def objects:
|
DifferDetails |
beginDiffObjects(DiffMergeable docDef,
DiffMergeable orgDef,
DifferDetails difDetails)
This method is the entry point call when the diffing process
begins on the document-level def.
|
DifferDetails |
diffChildren(DiffMergeable docDef,
DiffMergeable orgDef,
DifferDetails difDetails)
Performs diff of children defs.
|
DifferDetails |
diffContents(DiffMergeable docDef,
DiffMergeable orgDef,
DifferDetails difDetails)
Performs diff of scalar values.
|
DifferDetails |
diffObjects(DiffMergeable docDef,
DiffMergeable orgDef,
DifferDetails difDetails)
The work-horse method performing diff between two defs of this
def type.
|
DifferDetails |
ensureDifferDetails(DifferDetails difDetails)
Ensures that we have a valid
DifferDetails . |
protected ViewAttributeDefImpl |
findViewAttrDefByBaseAttrName(java.lang.String name,
AttributeDefImpl attr) |
protected ViewAttributeDefImpl |
findViewAttrDefByViewAttrName(java.lang.String name,
AttributeDefImpl attr) |
protected ViewAttributeDefImpl |
findViewAttributeDefImpl(java.lang.String name) |
protected java.util.ArrayList |
findViewAttributeDefImpls(AttributeDefImpl attr) |
AssociationReference[] |
getAssociationReferences() |
DefObject |
getDef() |
java.lang.String |
getDefTypeName()
Returns the XML def type name of this defintion object, e.g.,
"PDefEntityObject".
|
java.lang.String |
getDefXMLElementTag() |
java.lang.String |
getDefXMLNameSpace() |
java.lang.String |
getIdentificationAttributeName()
return the attribute name for identification on an xml element.
|
int |
getJoinType()
Returns the join type if the Entity Reference participates in one.
|
static int |
getJoinType(java.lang.String type) |
static java.lang.String |
getJoinTypeAsString(int joinType)
Returns the join type as a
String so that
it can be used in SQL generation. |
java.lang.String |
getMergeableFullName()
Returns the fully qualified name of the diff-mergeable definition object.
|
java.lang.String |
getMergeableName()
Returns the diff-mergeable definition's name (short form).
|
DefPersistable |
getOrigObject() |
ViewAttributeDefImpl[] |
getViewAttributeDefImpls() |
java.lang.String |
getXMLElementTag()
Returns a piece of static info for the type of object this is invoked
upon.
|
boolean |
isDeleteParticipant()
Does this Referant Entity participate in the Delete processing in
this usage.
|
boolean |
isDirty()
This method returns if an Object is modified from last save/load
|
boolean |
isEffectiveDated()
Checks if the underlying entity is used in an
effective dated fashion or not.
|
boolean |
isEntireObjectTable() |
boolean |
isInsertParticipant()
Does this Referant Entity participate in the Delete processing in
this usage.
|
boolean |
isLockParticipant()
Does this Referant Entity participate in the Lock processing in
this usage.
|
boolean |
isNew()
This method returns if this object is previously persisted.
|
boolean |
isNewRecurse() |
boolean |
isReadOnly() |
boolean |
isReference()
Does this Referant Entity participate in the DML.
|
static boolean |
isSame(RowReference left,
RowReference right) |
boolean |
isSkipWrite() |
boolean |
isWriteObject(DefPersistable parentObj,
DefWriter defWriter) |
void |
setDirty(boolean b)
This method marks the Object dirty
|
void |
setEntireObjectTable(boolean b) |
void |
setFullName(java.lang.String name)
Give this object a fully-qualified name.
|
void |
setJoinType(int joinType)
Set the type of join.
|
void |
setName(java.lang.String name)
Name this object.
|
void |
setNew(boolean b)
This method marks the as previously persisted.
|
void |
setNewRecurse(boolean b) |
void |
setOrigObject(DefPersistable origObject) |
void |
setReadOnly(boolean state)
Set the Referant Entity to READ-ONLY entity usage
|
void |
setReference(boolean state)
Set the Referant Entity to REFERENCE-ONLY enable entity lookup on source key attribute change.
|
void |
setSkipWrite(boolean b) |
void |
writeChildren(DefWriter jos)
Writes the Object's children to the Persistent storage
|
void |
writeContents(DefWriter jos)
Objects should write their persistence output in this method
|
void |
writeObject(DefWriter jos)
Objects should write their persistence output in this method
|
addListener, applyPersonalization, applyPersonalization, create, createRef, createVariableValueManager, editCodeSource, ensureCodeSource, ensureVariableManager, findPersDefObject, getAdfmConfigStartupProperty, getAllProperties, getApplicationModule, getBooleanAdfmConfigProperty, getCompListeners, getCompListenersList, getDefFullName, getDefinitionManager, getDefinitionState, getDefManager, getDefName, getDefScope, getFullNameForPersDef, getHintValue, getLabel, getLabelPlural, getMessageBundleClass, getOperationDefinitions, getProxyClassName, getProxyClassName, getResourceBundleDef, getResourceBundleDef, getRootApplicationModule, getRowOperationDefinitions, getScriptOperationDefinitions, getScriptRowOperationDefinitions, getStaticDefFullName, getStringFromMessageBundle, getStructureDef, getTooltip, getVariableManager, hasVariables, isDead, isDynamicCodeSourceEnabled, isPersonalized, isRegWithPiggyMan, lookupExprDef, remove, resolvePropertyRaw, setParent, setProxyClassName
isPropertyExpression, setParent, setPropertiesMap
allocatePropertyMap, getFullName, getName, getParent, getProperties, getPropertiesAsStrings, getPropertiesMap, getProperty, getProperty, getPropertyExpressionDef, getPropertyExpressionsMap, getPropertyExprEval, getPropertyMap, getPropertyNamesSet, getRawPropertyValue, getResourcesFromBundle, hasProperty, mergePropertyMap, refreshProperty, removeProperty, removeProperty, requiresNamePrefixedResId, resolveObjectProperty, setPropertiesMap2, setProperty, setProperty, setPropertyExpression, setPropertyExpressionMap, setPropertyMap, setRawPropertyValue
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getFullName
getFullName, getName
getProperties, getProperty, getProperty, refreshProperty
getName
getFullName
getProperty, removeProperty, setProperty
public static final byte EFFDT_USAGE_NO_OVERRIDE
public static final byte EFFDT_USAGE_OVERRIDE_FALSE
public static final byte EFFDT_USAGE_HAS_IMPLICIT_ATTRS
public static final java.lang.String EFFDT_USAGE_OVERRIDE_FALSE_STR
public static final java.lang.String EFFDT_USAGE_HAS_IMPLICIT_ATTRS_STR
public void setName(java.lang.String name)
ComponentObjectImpl
setName
in class ComponentObjectImpl
name
- the name to be given to this object.public java.lang.String getMergeableName()
DiffMergeable
getMergeableName
in interface DiffMergeable
public java.lang.String getMergeableFullName()
DiffMergeable
getMergeableFullName
in interface DiffMergeable
public boolean isNew()
DefPersistable
isNew
in interface DefPersistable
public void setNew(boolean b)
DefPersistable
setNew
in interface DefPersistable
b
- If true the Object is marked as new object.public boolean isNewRecurse()
isNewRecurse
in interface DefPersistable
public void setNewRecurse(boolean b)
setNewRecurse
in interface DefPersistable
public boolean isDirty()
DefPersistable
isDirty
in interface DefPersistable
public void setDirty(boolean b)
DefPersistable
setDirty
in interface DefPersistable
b
- If true the Object is marked Dirty.public boolean isSkipWrite()
isSkipWrite
in interface DefPersistable
public void setSkipWrite(boolean b)
setSkipWrite
in interface DefPersistable
public boolean isWriteObject(DefPersistable parentObj, DefWriter defWriter)
isWriteObject
in interface DefPersistable
public DefPersistable getOrigObject()
getOrigObject
in interface DefPersistable
public void setOrigObject(DefPersistable origObject)
setOrigObject
in interface DefPersistable
public void setFullName(java.lang.String name)
NamedObjectImpl
setFullName
in class NamedObjectImpl
name
- this object's fully-qualified name;
the package name concatenated with the class name.public DefObject getDef()
getDef
in class ComponentObjectImpl
public ViewAttributeDefImpl[] getViewAttributeDefImpls()
public AssociationReference[] getAssociationReferences()
public boolean isLockParticipant()
public boolean isDeleteParticipant()
public boolean isInsertParticipant()
public boolean isEntireObjectTable()
public void setEntireObjectTable(boolean b)
public void setReference(boolean state)
state
- True to be REFERENCE, false otherwise.public void setReadOnly(boolean state)
state
- True to be READONLY , false otherwise.public boolean isReference()
protected ViewAttributeDefImpl findViewAttrDefByViewAttrName(java.lang.String name, AttributeDefImpl attr)
protected ViewAttributeDefImpl findViewAttrDefByBaseAttrName(java.lang.String name, AttributeDefImpl attr)
protected ViewAttributeDefImpl findViewAttributeDefImpl(java.lang.String name)
protected java.util.ArrayList findViewAttributeDefImpls(AttributeDefImpl attr)
public boolean isReadOnly()
public void writeObject(DefWriter jos)
PersistentDefinition
writeObject
in interface PersistentDefinition
jos
- the Output storage for persistencepublic void writeContents(DefWriter jos)
PersistentDefinition
writeContents
in interface PersistentDefinition
jos
- the Output storage for persistencepublic void writeChildren(DefWriter jos)
PersistentDefinition
writeChildren
in interface PersistentDefinition
jos
- the Output storage for persistencepublic java.lang.String getDefTypeName()
DiffMergeable
getDefTypeName
in interface DiffMergeable
public java.lang.String getXMLElementTag()
PersistentDefinition
getXMLElementTag
in interface PersistentDefinition
public java.lang.String getDefXMLElementTag()
getDefXMLElementTag
in interface PersistentDefinition
public java.lang.String getDefXMLNameSpace()
getDefXMLNameSpace
in interface PersistentDefinition
public java.lang.String getIdentificationAttributeName()
PersistentDefinition
getIdentificationAttributeName
in interface PersistentDefinition
public void setJoinType(int joinType)
setFromClause
and setWhereClause
on the ViewDefImpl
class.joinType
- The type of joinpublic int getJoinType()
public static java.lang.String getJoinTypeAsString(int joinType)
String
so that
it can be used in SQL generation.String
objectpublic static int getJoinType(java.lang.String type)
public boolean isEffectiveDated()
true
if the usage is effective dated,
public static boolean isSame(RowReference left, RowReference right)
public DifferDetails ensureDifferDetails(DifferDetails difDetails)
DiffMergeable
DifferDetails
.
This method is to create a DifferDetails
object to
be used for diffing if necessary. The difDetails
may come in
as null
. By calling this method, we can ensure that
a non-null difDetails
is there. So, instead of
writing:
if (difDetails == null) { difDetails = new DifferDetails(..); } difDetails.addDiffDetail(..);we can write
(difDetails = diffMergeable.ensureDifferDetails(difDetails)).addDiffDetail(..);
ensureDifferDetails
in interface DiffMergeable
difDetails
- the incoming DifferDetails
. It may
be null
.difDetails
if it wasn't
null
coming in, or a new DifferDetails
if
the incoming difDetails
was null
public DifferDetails diffContents(DiffMergeable docDef, DiffMergeable orgDef, DifferDetails difDetails)
DiffMergeable
orgDef
. Then, help
methods on DifferBase
can be used to diff the attr values
and accumulate the details of diff in difDetails
.
Here is example code snippet:
private static final String DIFF_STRING_ELEMS[] =
{
"MyStringVal1",
"MyStringVal2"
};
private static final String DIFF_INT_ELEMS[] =
{
"MyIntVal",
}
public DifferDetails diffContents(DiffMergeable docDef, DiffMergeable orgDef, DifferDetails difDetails)
{
<Your-def-class> orgDefImpl = (<Your-def-class>) orgDef;
final String editStringValues[] =
{
this.getMyStringVal1(),
this.getMyStringVal2()
};
String orgStringValues[] = null;
if (orgDef != null)
{
String orgV[] =
{
orgDefImpl.getMyStringVal1(),
orgDefImpl.getMyStringVal2()
};
orgStringValues = orgV;
}
final int editIntValues[] =
{
this.getMyIntVal(),
};
int orgIntValues[] = null;
if (orgDef != null)
{
int orgV[] =
{
orgDefImpl.getMyIntVal()
};
orgIntValues = orgV;
}
difDetails = DifferBase.diffStringArray(this, DIFF_STRING_ELEMS, editStringValues, orgStringValues, difDetails);
difDetails = DifferBase.diffIntArray(this, DIFF_INT_ELEMS, editIntValues, orgIntValues, difDetails);
return difDetails;
}
diffContents
in interface DiffMergeable
docDef
- the document-level definitionorgDef
- the original definition. It could be
null
if the definition did not exist originallydifDetails
- the DifferDetails
that accumulate
the details of diff from the document-level (top-level) defDifferDetails
that has all the details
of diffpublic DifferDetails diffChildren(DiffMergeable docDef, DiffMergeable orgDef, DifferDetails difDetails)
DiffMergeable
difDetails
and
return it at the end.
For example, if this def has Child1 and Child2, its implementation should look something like:
public DifferDetails diffChildren(DiffMergeable docDef, DiffMergeable orgDef, DifferDetails difDetails)
{
difDetails = diffChildrenChild1(docDef, orgDef, difDetails);
difDetails = diffChildrenChild1(docDef, orgDef, difDetails);
return difDetails;
}
where diffChildrenChild1()
uses DifferChildren
's
helper method diffChildrenList
to diff the child defs.
diffChildren
in interface DiffMergeable
docDef
- the document-level definitionorgDef
- the original definition. It could be
null
if the definition did not exist originallydifDetails
- the DifferDetails
that accumulate
the details of diff from the document-level (top-level) defDifferDetails
that has all the details
of diffpublic DifferDetails beginDiffObjects(DiffMergeable docDef, DiffMergeable orgDef, DifferDetails difDetails)
DiffMergeable
DiffMergeable
's. 'this'
object is the
changed definition.
beginDiffObjects
in interface DiffMergeable
docDef
- the document-level definitionorgDef
- the original definition. It could be
null
if the definition did not exist originallydifDetails
- the DifferDetails
that accumulate
the details of diff from the document-level (top-level) defDifferDetails
that has all the details
of diffpublic DifferDetails diffObjects(DiffMergeable docDef, DiffMergeable orgDef, DifferDetails difDetails)
DiffMergeable
diffContents
to diff scalar values and diffChildren
to diff
children objects. The children objects themselves are expected
to be DiffMergeable
. 'this'
object is the
changed definition.
diffObjects
in interface DiffMergeable
docDef
- the document-level definitionorgDef
- the original definition. It could be
null
if the definition did not exist originallydifDetails
- the DifferDetails
that accumulate
the details of diff from the document-level (top-level) defDifferDetails
that has all the details
of diffpublic void applyDiffContents(DifferDetails dif, DiffResolver resolver)
DiffMergeable
orgDef - original def object (from the branch point)
editDef - def object into which changes are to be merge
toMergeDef - def object to be merged (source of changes)
For sandbox refresh operation, orgDef
comes from the branch
point, editDef
from the sandbox, toMergeDef
from the
mainline of the repos. With these three defs, we first diff editDef
against orgDef
, producing editDifDetails
.
Similarly, toMergeDef
is diffed against orgDef
,
producing toMergeDifDetails
. The diff engine then
walks through these two sets of diffs and identifies conflicts.
After the conflicts are all resolved, we apply appropriate
changes to editDef
.
applyDiffContents
is called to apply changes to
scalar values. dif
contains the changed values to
be applied to 'this'
object. Use sample code like
the following:
public void applyDiffContents(DifferDetails dif, DiffResolver resolver)
{
DifferChangeMap detailMap = dif.getDetailMap();
Object[] updValues;
// DIFF_STRING_ELEMS from the above example code
for (int j = 0; j < DIFF_STRING_ELEMS.length; j++)
{
if ((updValues = (Object[]) detailMap.getValue(DIFF_STRING_ELEMS[j])) != null)
{
switch(j)
{
case 0:
setMyStringVal1((String) updValues[0]);
break;
case 1:
setMyStringVal2((String) updValues[0]);
break;
}
}
}
for (int j = 0; j < DIFF_INT_ELEMS.length; j++)
{
if ((updValues = (Object[]) detailMap.getValue(DIFF_INT_ELEMS[j])) != null)
{
switch(j)
{
case 0:
setMyIntVal((Integer) updValues[0]);
break;
}
}
}
}
Notice that the index specified in the case
statement is the array index of the attr in the String, int,
or boolean array.
applyDiffContents
in interface DiffMergeable
dif
- changes to be applied to 'this'
defresolver
- the diff resolver used in diff/merge operationpublic void applyDiffChildren(DifferDetails dif, DiffResolver resolver)
DiffMergeable
dif
contains the
changes to be applied to the children. For each child def, this method
should first retrieve the diff details for the child, which is of type
DifferChildren
. Then, it should call
DifferChildren.applyDiffChanges(oracle.jbo.mom.DiffChildrenMerge, oracle.jbo.mom.DiffResolver)
to perform
the change operation.
applyChanges()
requires a
DiffChildrenMerge
object, which has the insert,
update, and remove methods. 'this'
def object must
provide implmementation of these operations.
Here is a sample:
public void applyDiffChildren(DifferDetails dif, DiffResolver resolver)
{
DifferChangeMap detailMap = dif.getDetailMap();
if (detailMap != null)
{
DifferChildren difChild1 = (DifferChildren) detailMap.getValue(<XML-tag-for-Child1>);
if (difVCs != null)
{
DiffChildrenMerge dm = new DiffChildrenMerge()
{
public void insertChild(Object id, Object value)
{
.. perform insert op for Child1 ..
}
public void updateChild(Object id, Object value, Object oldValue)
{
.. perform update op for Child1 ..
}
public void removeChild(Object id)
{
.. perform remove op for Child1 ..
}
};
difChild1.applyDiffChanges(dm, resolver);
}
// Similarly for Child2
}
}
applyDiffChildren
in interface DiffMergeable