com.onwbp.adaptation
Class AdaptationTable

java.lang.Object
  extended bycom.onwbp.adaptation.AdaptationTable

public final class AdaptationTable
extends Object

An instance of this class holds the occurrences of a node that has been declared in Schema as osd:table. The declaration of a table is specified at this page.

The schema instance adaptation that contains the table is called the container adaptation. A table is accessed from the container adaptation by calling method ReadContext.getTable(Path).

All the occurrences of a table are represented as adaptations and as such they benefit from inheritance features.


Method Summary
 PrimaryKey computePrimaryKey(Adaptation anOccurrence)
          This method returns the same result as Adaptation.getOccurrencePrimaryKey().
 PrimaryKey computePrimaryKey(com.onwbp.adaptation.uifacade.HrNode aRootNode)
          Deprecated. Replaced by computePrimaryKey(ValueContext).
 PrimaryKey computePrimaryKey(Object[] primaryKeyValues)
          Returns the PrimaryKey object that corresponds to the specified raw values.
 PrimaryKey computePrimaryKey(ValueContext aContext)
           
 Request createRequest()
          Creates a new request on this table.
 RequestResult createRequestResult(String predicate)
          Returns the RequestResult for the specified predicate.
 RequestResult createRequestResult(String predicate, RequestSortCriteria sortCriteria)
          Returns the RequestResult for the specified predicate and sort criteria .
 boolean equals(Object object)
           
 Adaptation getContainerAdaptation()
          Returns the instance holding this table.
 com.onwbp.adaptation.uifacade.HrNode getNodeForUpdatingContent(AdaptationName aName)
          Deprecated. Use ProcedureContext.getContext(AdaptationName).
 Path[] getPrimaryKeySpec()
          Returns the paths of the schema nodes that compose the primary key of this table.
 AdaptationName getRootKey()
          Returns the key to the virtual root record of this table.
 SchemaNode getSchemaNode()
          Deprecated. Replaced by getTableOccurrenceRootNode()
 SchemaNode getTableNode()
          Returns the node on the instance side.
 SchemaNode getTableOccurrenceRootNode()
          Returns the root node that defines the occurrence structure.
 Path getTablePath()
          Returns the path of the container node.
 ValidationReport getValidationReport()
          Returns the up-to-date validation report associated to this table.
 ValidationReport getValidationReport(boolean ensureActivation)
          Returns the up-to-date validation report associated with this table.
 ValidationReport getValidationReport(boolean ensureActivation, boolean updateValidationReport)
          Returns the validation report associated with this table.
 boolean isEdition()
          Deprecated. Replaced by the method Adaptation.isNewOrModifiedInCurrentBranch().
 boolean isPrimaryKeyComplete(ValueContext aContext)
          Returns false if at least one field in the primary key in the context specified is not set.
 Adaptation lookupAdaptationByName(AdaptationName aName)
          Returns the occurrence specified by its name, or null if it does not exist.
 Adaptation lookupAdaptationByPrimaryKey(PrimaryKey aKey)
          Returns the occurrence specified by its primary key, or null if it does not exist or if it is in occulting mode.
 Adaptation lookupAdaptationByPrimaryKey(PrimaryKey aKey, boolean includeOcculting)
          Returns the occurrence specified by its primary key.
 Adaptation lookupAdaptationByPrimaryKey(PrimaryKey aKey, boolean ignored, boolean includeOcculting)
          Deprecated. Replaced by the method lookupAdaptationByPrimaryKey(PrimaryKey, boolean).
 Adaptation lookupAdaptationByPrimaryKey(ValueContext aContext)
          Returns the occurrence that has the primary key specified by the context passed as argument, or null if it does not exist if it is in occulting mode.
 Adaptation lookupAdaptationByPrimaryKey(ValueContext aContext, boolean includeOcculting)
          Returns the occurrence specified by its primary key.
 Adaptation lookupAdaptationByPrimaryKey(ValueContext aContext, boolean ignored, boolean includeOcculting)
          Deprecated. Replaced by the method lookupAdaptationByPrimaryKey(ValueContext, boolean).
 List selectOccurrences(String predicate)
          Returns the list of occurrences which resolve the specified predicate.
 List selectOccurrences(String predicate, RequestSortCriteria sortCriteria)
          Returns the list of occurrences which resolve the specified predicate, and sorts the result.
 String toPublicReference()
          Returns an information string that identifies the table (instance reference and table path).
 String toString()
           
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

toPublicReference

public String toPublicReference()
Returns an information string that identifies the table (instance reference and table path).


toString

public String toString()
See Also:
toPublicReference()

lookupAdaptationByPrimaryKey

public Adaptation lookupAdaptationByPrimaryKey(ValueContext aContext)
Returns the occurrence that has the primary key specified by the context passed as argument, or null if it does not exist if it is in occulting mode.

See Also:
lookupAdaptationByPrimaryKey(ValueContext, boolean)

lookupAdaptationByPrimaryKey

public Adaptation lookupAdaptationByPrimaryKey(ValueContext aContext,
                                               boolean includeOcculting)
Returns the occurrence specified by its primary key. Returns null if:

The occurrence that is returned can be inherited from an ancestor table.

Parameters:
aContext - Context that specifies the primary key of the occurrence to look up.
includeOcculting - If true, an occulting adaptation may be returned, if false it will not return such an adaptation but null instead.

lookupAdaptationByPrimaryKey

public Adaptation lookupAdaptationByPrimaryKey(ValueContext aContext,
                                               boolean ignored,
                                               boolean includeOcculting)
Deprecated. Replaced by the method lookupAdaptationByPrimaryKey(ValueContext, boolean).


lookupAdaptationByPrimaryKey

public Adaptation lookupAdaptationByPrimaryKey(PrimaryKey aKey)
Returns the occurrence specified by its primary key, or null if it does not exist or if it is in occulting mode.


lookupAdaptationByPrimaryKey

public Adaptation lookupAdaptationByPrimaryKey(PrimaryKey aKey,
                                               boolean includeOcculting)
Returns the occurrence specified by its primary key. Returns null if:

The occurrence that is returned may be inherited from an ancestor table.

Parameters:
aKey - Identity of the occurrence to look up.
includeOcculting - If true, an occulting adaptation may be returned, if false it will not return such an adaptation but null instead.

lookupAdaptationByPrimaryKey

public Adaptation lookupAdaptationByPrimaryKey(PrimaryKey aKey,
                                               boolean ignored,
                                               boolean includeOcculting)
Deprecated. Replaced by the method lookupAdaptationByPrimaryKey(PrimaryKey, boolean).


computePrimaryKey

public PrimaryKey computePrimaryKey(Adaptation anOccurrence)
This method returns the same result as Adaptation.getOccurrencePrimaryKey().


computePrimaryKey

public PrimaryKey computePrimaryKey(ValueContext aContext)

computePrimaryKey

public PrimaryKey computePrimaryKey(Object[] primaryKeyValues)
Returns the PrimaryKey object that corresponds to the specified raw values.

Parameters:
primaryKeyValues - values of the primary key fields. They must be in the same order as the fields declared in in osd:table/primaryKeys element.
Throws:
IllegalArgumentException - if one argument is null, if both specified arrays do not have the same length, or if one value is not of the expected type.
ClassCastException - if one value is not of the expected Java type.

computePrimaryKey

public PrimaryKey computePrimaryKey(com.onwbp.adaptation.uifacade.HrNode aRootNode)
Deprecated. Replaced by computePrimaryKey(ValueContext).


isPrimaryKeyComplete

public boolean isPrimaryKeyComplete(ValueContext aContext)
Returns false if at least one field in the primary key in the context specified is not set.


getPrimaryKeySpec

public Path[] getPrimaryKeySpec()
Returns the paths of the schema nodes that compose the primary key of this table.


getSchemaNode

public SchemaNode getSchemaNode()
Deprecated. Replaced by getTableOccurrenceRootNode()

See Also:
getTableNode()

getTableOccurrenceRootNode

public SchemaNode getTableOccurrenceRootNode()
Returns the root node that defines the occurrence structure.

See Also:
getTableNode()

getTableNode

public SchemaNode getTableNode()
Returns the node on the instance side. It is a terminal node.

See Also:
getTableOccurrenceRootNode(), SchemaNode.isTableNode()

getContainerAdaptation

public Adaptation getContainerAdaptation()
Returns the instance holding this table.


getNodeForUpdatingContent

public com.onwbp.adaptation.uifacade.HrNode getNodeForUpdatingContent(AdaptationName aName)
Deprecated. Use ProcedureContext.getContext(AdaptationName).


getTablePath

public Path getTablePath()
Returns the path of the container node.


getRootKey

public AdaptationName getRootKey()
Returns the key to the virtual root record of this table. This technical record is not seen by the end users but is useful for managing a hierarchical set of all the occurrences in this table and its descendants, for example for deletion.

Each table has a unique virtual root record and exists even if the table is empty. It, itself, is not persisted, and does not support modifications.

Returns:
the key of the virtual root of this table.
See Also:
AdaptationHome.findAllDescendants(Adaptation), ProcedureContext.doDelete(AdaptationName, boolean)

isEdition

public boolean isEdition()
Deprecated. Replaced by the method Adaptation.isNewOrModifiedInCurrentBranch().


lookupAdaptationByName

public Adaptation lookupAdaptationByName(AdaptationName aName)
Returns the occurrence specified by its name, or null if it does not exist.


createRequest

public Request createRequest()
Creates a new request on this table.

See Also:
createRequestResult(String), createRequestResult(String, RequestSortCriteria)

createRequestResult

public RequestResult createRequestResult(String predicate,
                                         RequestSortCriteria sortCriteria)
Returns the RequestResult for the specified predicate and sort criteria .

This method is equivalent to the method selectOccurrences(String).

Parameters:
predicate - XPath simplified expression of a filter to be applied on the table occurrences. If null, no filter is applied.
sortCriteria - Criteria for sorting the result. If null, no specific order is applied.
See Also:
XPath supported syntax. , selectOccurrences(String, RequestSortCriteria), Request.setXPathFilter(String), Request.setSortCriteria(RequestSortCriteria)

createRequestResult

public RequestResult createRequestResult(String predicate)
Returns the RequestResult for the specified predicate.

This method is equivalent to the method selectOccurrences(String).

Parameters:
predicate - XPath simplified expression of a filter to apply on the table occurrences. If null, no filter is applied.
See Also:
XPath supported syntax. , selectOccurrences(String), Request.setXPathFilter(String)

selectOccurrences

public List selectOccurrences(String predicate,
                              RequestSortCriteria sortCriteria)
Returns the list of occurrences which resolve the specified predicate, and sorts the result.

This method is equivalent to the method createRequestResult(String).

Parameters:
predicate - XPath simplified expression of a filter to apply on the table occurrences. If null, no filter is applied.
sortCriteria - Criteria for sorting the result. If null, no specific order is applied.
See Also:
XPath supported syntax. , createRequestResult(String, RequestSortCriteria), Request.setXPathFilter(String)

selectOccurrences

public List selectOccurrences(String predicate)
Returns the list of occurrences which resolve the specified predicate.

This method is equivalent to the method createRequestResult(String).

See Also:
XPath supported syntax. , createRequestResult(String), Request.setXPathFilter(String)

getValidationReport

public ValidationReport getValidationReport()
Returns the up-to-date validation report associated to this table.

This method is equivalent to:

AdaptationTable.getValidationReport(true);

See Also:
Adaptation.getValidationReport(), getValidationReport(boolean), getValidationReport(boolean, boolean)

getValidationReport

public ValidationReport getValidationReport(boolean ensureActivation)
Returns the up-to-date validation report associated with this table. The validation takes into account all the various constraints defined by the underlying schema.

The report returned by this method is not affected by updates done after this method is called. The rules for ensuring that Master Data remain valid (regarding possible concurrent updates) are explained in section Consistency and validation.

This method is equivalent to:

AdaptationTable.getValidationReport(ensureActivation, true);

Parameters:
ensureActivation - if true, validation also checks that the instance is activated (it adds an error if this is not the case).
See Also:
Adaptation.getValidationReport(boolean), getValidationReport(), getValidationReport(boolean, boolean)

getValidationReport

public ValidationReport getValidationReport(boolean ensureActivation,
                                            boolean updateValidationReport)
Returns the validation report associated with this table. The validation takes into account all the various constraints defined by the underlying schema.

The report returned by this method is not affected by updates done after this method is called. The rules for ensuring that Master Data remain valid (regarding possible concurrent updates) are explained in section Consistency and validation.

Parameters:
ensureActivation - if true, validation also checks that the instance is activated (it adds an error if this is not the case).
updateValidationReport - if true, an up-to-date validation report of this adaptation is computed; if false, this adaptation is validated only if it has not been previously validated.
See Also:
Adaptation.getValidationReport(boolean)

equals

public boolean equals(Object object)


(report a bug)
EBX.Platform 4.8.4 [0722]
Copyright Orchestra Networks 2000-2010. All rights reserved.