public class ViewAccessorDef extends DefObject implements ViewAccessor
PersistableDefObject.CustomizationType, PersistableDefObject.PersonalizationTypeJIT_PACKAGE_NAME, mDebugToSkipEmptyDocForBug24949961, mEditedProperties, mEditedPropertyExprsDEF_MDS_CLIENT_KEY, DEF_SCOPE_ALL, DEF_SCOPE_PERS, DEF_SCOPE_SESSION, DEF_SCOPE_SHARED, DEF_SCOPE_SITE, DEF_SCOPE_USER, mBaseDefObject, mExtendedDefObjects, mObjectResolved, PERSDEF_MDS_CLIENT_KEY, PROPERTY_EXPRMAPmFullName, mObjName, mParent, mProperties, RES_ID_SUFFIX, RESID_SUFFIXFLAG_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| Constructor and Description |
|---|
ViewAccessorDef() |
ViewAccessorDef(java.lang.String name,
java.lang.String viewDefFullName) |
ViewAccessorDef(java.lang.String name,
java.lang.String amUsageName,
java.lang.String viewInstanceName) |
ViewAccessorDef(ViewAccessorDef src)
For internal framework use only.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAppliedViewCriteria(PDefViewCriteria pVC) |
void |
addBoundParameter(java.lang.String name,
ExpressionDef exprDef) |
void |
addBoundParameter(java.lang.String name,
java.lang.String expr) |
void |
addBoundParameterUsingExprValueSupplier(java.lang.String name,
ExpressionDef exprDef,
java.lang.String viewDefFullName) |
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:
|
void |
applyViewAccessorVCs(ViewObjectImpl vo) |
void |
copyFrom(ViewAccessorDef other) |
ViewObject |
createViewObject(ApplicationModuleImpl am,
java.lang.String voName) |
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.
|
java.lang.String |
getAMUsageName() |
java.util.List<PDefViewCriteria> |
getAppliedViewCriterias() |
java.util.ArrayList |
getBoundParameterList() |
BoundParameters |
getBoundParameters() |
RowDef |
getDef() |
int |
getDefTypeId() |
java.lang.String |
getDefXMLElementTag() |
java.lang.String |
getExprEvalEntityUsageName() |
static java.lang.String |
getExprEvalEntityUsageNameFromRowSet(RowSet rs) |
java.lang.String |
getFileName() |
java.lang.Class |
getMessageBundleClass() |
java.lang.String |
getOrderBy() |
ResourceBundleDef |
getResourceBundleDef() |
int |
getResultIndex() |
boolean |
getRowLevelBinds() |
java.lang.String |
getViewDefFullName()
Obtain the accessor view def full name.
|
java.lang.String |
getViewInstanceName() |
boolean |
isDirty()
This method returns if an Object is modified from last save/load
|
boolean |
isEditable() |
boolean |
isForPersonalization() |
boolean |
isPreferredCriteriaAccessor() |
boolean |
isSharedInstance() |
void |
loadXMLContents(DefElement xmlElement,
java.lang.String fullName) |
PDefViewCriteria |
lookupAppliedViewCriteria(java.lang.String name) |
static ViewAccessorDef |
lookupViewAccessorDef(java.lang.String vaDesc,
ViewObjectImpl vo) |
boolean |
removeAppliedViewCriteria(java.lang.String name) |
void |
setAMUsageName(java.lang.String amUsageName) |
protected void |
setDefForComponent(ComponentObjectImpl comp) |
void |
setForPersonalization(boolean b) |
void |
setOrderBy(java.lang.String orderBy) |
protected void |
setParent(NamedObjectImpl parent)
Sets this object's parent.
|
void |
setResultIndex(int index) |
void |
setRowLevelBinds(boolean b) |
void |
setSharedInstance(boolean b) |
void |
setViewDefFullName(java.lang.String viewDefName) |
void |
setViewInstanceName(java.lang.String voName) |
protected void |
unsetDefForComponent(ComponentObjectImpl comp) |
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
|
addChildren, callFinishedLoading, ensureVariableManager, finishedLoading, getAdfmConfigStartupProperty, getAllProperties, getBaseDefObject, getBooleanAdfmConfigProperty, getDefXMLNameSpace, getVariableManager, getVarMgrParents, hasVariables, isDeprecated, isFromCustomization, loadProperties, loadVariables, resolvePropertyRaw, resolveReferences, setBaseDefObject, setBaseDefObject, setNameaddDefImport, addExtendedDefObject, addSavedDocName, adjustPropertyMapForWrite, allocatePDef, allocatePropertyMap, allocatePropertyMapForEdits, baseIsWriteObject, beginDiffObjects, buildChildName, buildFileName, checkEditable, checkEditableWithDefWriter, checkStructWithOld, close, createEditPDef, createFromXML, deregisterDefObject, deregisterHLDef, deregisterSessionObject, diffChildrenHLDefs, diffChildrenProperties, diffObjects, ensureDifferDetails, ensureDifferSkip, extractCustIntoPDef, findDefImport, forgetChanges, getBaseDir, getBasePackage, getChildren, getDefImports, getDefManager, getDefTypeName, getDefWriter, getDifferSkip, getEditedPropertiesMap, getEditedPropertyExpressionsMap, getEditedPropertyMap, getEditObject, getEditVersionsAsString, getExtendedDefObjectsInternal, getFullDirName, getFullFileName, getHLDefMap, getIdentificationAttributeName, getMajorVersion, getMergeableFullName, getMergeableName, getMinorVersion, getOrigObject, getPropertyMap, getPropertyNamesSet, getSavedDocNames, getSessionSyncLock, getSubstitutedNames, getSyncLock, getXMLElementTag, guaranteePath, hasExtendedDefObjects, includeCustomizationLayerInfo, isAutoMerged, isCreateEditPDef, isCustomizationEnabled, isCustomizationEnabled, isFromTip, isInheritPolicyStrict, isLoadBase, isLoadHLDefs, isMajorVersionChanged, isMinorVersionChanged, isNew, isNewRecurse, isPersonalizationEnabled, isPersonalizationEnabled, isPropertyExpression, isSaveToJSON, isSkipWrite, isWriteObject, loadDefImports, loadDefObject, loadXMLContentsNoResolve, lockDefinitionContext, lookupHLDef, makeNew, mergeChanges, mergeEditedPropertiesForJSON, mergePropertyMap, objectRemoved, postSaveContents, readJSONObject, reapplyChanges, registerClass, registerDefObject, registerHLDef, registerSessionDefObject, registerSiteDefObject, reloadFromXMLContents, remove, removeAndDelete, removeDefImport, removeExtendedDefObject, removeProperty, saveJSONContents, saveXMLContents, setCustomizationEnabled, setCustomizationEnabled, setDefaultBaseDir, setDefMgr, setDirty, setEditable, setEditableFlag, setEditableObject, setForRuntime, setFullName, setFullNameInternal, setLoadBase, setLoadHLDefs, setMajorVersionChanged, setNew, setNewRecurse, setOrigObject, setPersonalizationEnabled, setPersonalizationEnabled, setProperty, setPropertyExpression, setPropertyMap, setSkipWrite, setupDefWriterFromMO, setWholeDefDirty, setWholeDefNew, staticUpdateChildrenList, transferDefChangesInto, unlockDefinitionContext, updateChildObject, updateChildrenList, updateMdsKeyFromTip, verifyVersion, verifyVersionNullCheck, writeHeaderForNew, writeJSONContents, writeObject, writeVersion, writeXMLContentsaddPropertySetName, enableUpdateCheck, getAllExtendedDefObjects, getContainerDef, getContainerName, getDefinitionState, getDefScope, getExtendedDefObjects, getMdsKey, getMdsReference, getMdsReferenceName, getPropertySetName, getPropertySetNames, getRootBaseDefObject, isBaseDefFor, isComponentDefinition, isDynamicDefinitionObject, isObjectResolved, isSubtypeOf, isSuppressUpdateCheck, loadCustomProperties, loadPropertiesInMap, loadPropertySetNames, loadSchemaProperties, objectFound, objectInserted, setDefScope, setMdsKey, setMdsReference, setObjectResolved, setPropertySetName, staticLoadCustomProperties, staticLoadSchemaProperties, suppressUpdateCheckgetFullName, getName, getParent, getProperties, getPropertiesAsStrings, getPropertiesMap, getProperty, getProperty, getPropertyExpressionDef, getPropertyExpressionsMap, getPropertyExprEval, getRawPropertyValue, getResourcesFromBundle, getStringFromMessageBundle, hasProperty, refreshProperty, removeProperty, requiresNamePrefixedResId, resolveObjectProperty, setPropertiesMap, setPropertiesMap2, setProperty, setPropertyExpressionMap, setRawPropertyValueclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetNamegetNamegetFullNamegetProperty, removeProperty, setProperty@Concealed public ViewAccessorDef(ViewAccessorDef src)
public ViewAccessorDef()
public ViewAccessorDef(java.lang.String name,
java.lang.String viewDefFullName)
public ViewAccessorDef(java.lang.String name,
java.lang.String amUsageName,
java.lang.String viewInstanceName)
public void copyFrom(ViewAccessorDef other)
public boolean isDirty()
DefPersistableisDirty in interface DefPersistableisDirty in class PersistableDefObjectpublic boolean isForPersonalization()
public void setForPersonalization(boolean b)
public int getDefTypeId()
getDefTypeId in class DefObjectpublic RowDef getDef()
public boolean isEditable()
isEditable in class PersistableDefObjectpublic java.lang.String getFileName()
getFileName in class PersistableDefObjectprotected void setParent(NamedObjectImpl parent)
DefObjectpublic java.lang.Class getMessageBundleClass()
getMessageBundleClass in interface VariableManagerOwnerBasepublic ResourceBundleDef getResourceBundleDef()
getResourceBundleDef in interface VariableManagerOwnerBaseprotected void setDefForComponent(ComponentObjectImpl comp)
setDefForComponent in class DefObjectprotected void unsetDefForComponent(ComponentObjectImpl comp)
unsetDefForComponent in class DefObjectpublic java.lang.String getViewDefFullName()
ViewAccessorgetViewDefFullName in interface ViewAccessorpublic void setViewDefFullName(java.lang.String viewDefName)
public java.lang.String getAMUsageName()
public void setAMUsageName(java.lang.String amUsageName)
public java.lang.String getViewInstanceName()
public void setViewInstanceName(java.lang.String voName)
public boolean isPreferredCriteriaAccessor()
public boolean isSharedInstance()
public void setSharedInstance(boolean b)
public boolean getRowLevelBinds()
public void setRowLevelBinds(boolean b)
public java.lang.String getOrderBy()
public void setOrderBy(java.lang.String orderBy)
public java.util.List<PDefViewCriteria> getAppliedViewCriterias()
public void addAppliedViewCriteria(PDefViewCriteria pVC)
public PDefViewCriteria lookupAppliedViewCriteria(java.lang.String name)
public boolean removeAppliedViewCriteria(java.lang.String name)
public BoundParameters getBoundParameters()
public java.util.ArrayList getBoundParameterList()
public void addBoundParameter(java.lang.String name,
java.lang.String expr)
public void addBoundParameter(java.lang.String name,
ExpressionDef exprDef)
public void addBoundParameterUsingExprValueSupplier(java.lang.String name,
ExpressionDef exprDef,
java.lang.String viewDefFullName)
public int getResultIndex()
public void setResultIndex(int index)
@Concealed public ViewObject createViewObject(ApplicationModuleImpl am, java.lang.String voName)
@Restricted public void applyViewAccessorVCs(ViewObjectImpl vo)
public static ViewAccessorDef lookupViewAccessorDef(java.lang.String vaDesc, ViewObjectImpl vo)
public void loadXMLContents(DefElement xmlElement, java.lang.String fullName)
loadXMLContents in class PersistableDefObjectpublic void writeChildren(DefWriter jos)
PersistentDefinitionwriteChildren in interface PersistentDefinitionwriteChildren in class DefObjectjos - the Output storage for persistencepublic void writeContents(DefWriter jos)
PersistentDefinitionwriteContents in interface PersistentDefinitionwriteContents in class PersistableDefObjectjos - the Output storage for persistencepublic java.lang.String getDefXMLElementTag()
getDefXMLElementTag in interface PersistentDefinitiongetDefXMLElementTag in class PersistableDefObjectpublic DifferDetails diffContents(DiffMergeable docDef, DiffMergeable orgDef, DifferDetails difDetails)
DiffMergeableorgDef. 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 DiffMergeablediffContents in class PersistableDefObjectdocDef - 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)
DiffMergeabledifDetails 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 DiffMergeablediffChildren in class DefObjectdocDef - 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 DiffMergeableapplyDiffContents in class PersistableDefObjectdif - changes to be applied to 'this' defresolver - the diff resolver used in diff/merge operationpublic void applyDiffChildren(DifferDetails dif, DiffResolver resolver)
DiffMergeabledif 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 DiffMergeableapplyDiffChildren in class DefObjectpublic java.lang.String getExprEvalEntityUsageName()
public static java.lang.String getExprEvalEntityUsageNameFromRowSet(RowSet rs)