Understanding Sun Master Index Processing (Repository)

Master Index Parent Object Classes (Repository)

A Java class is created to represent the parent object defined in the object definition of the master index application. The methods in this class provide the ability to create a parent object and to set or retrieve the field values for that object.

The name of the parent object class is the same as the name of each parent object, with the word “Object” appended. For example, if the parent object in your object structure is “Person”, the name of the parent class is “PersonObject”. The methods in this class include a constructor method for the parent object, and get and set methods for each field defined for the parent object. Most methods are named based on the name of the parent object and the fields and child objects defined for that object. In the following methods described for the parent object, ObjectName indicates the name of the parent object, Child indicates the name of a child object, and Field indicates the name of a field defined for the parent object.

Definition


class ObjectNameObject

Methods

ObjectNameObject

Description

This is the user-defined object name class for the parent object. You can instantiate this class to create a new instance of the parent object class.

Syntax

new ObjectNameObject()

Parameters

None.

Returns

An instance of the parent object.

Throws

ObjectException

addChild

Description

This method associates a new child object with the parent object. The new child object is of the type specified in the method name. For example, to associate a new address object with a parent object, call addAddress.

Syntax

void addChild(ChildObject child)


Note –

The type of object passed as a parameter depends on the child object to associate with the parent object. For example, the syntax for associating an address object is as follows:


 void addAddress(AddressObject address)

Parameters

Name 

Type 

Description 

child

ChildObject

A child object to associate with the parent object. The name and type of the parameter is specified by the child object name. 

Returns

None.

Throws

ObjectException

addSecondaryObject

Description

This method associates a new child object with the parent object. The object node passed as the parameter defines the child object type.

Syntax


void addSecondaryObject(ObjectNode obj)

Parameters

Name 

Type 

Description 

obj 

ObjectNode 

An ObjectNode representing the child object to associate with the parent object. 

Returns

None.

Throws

SystemObjectException

copy

Description

This method copies the structure and field values of the specified object node.

Syntax


ObjectNode copy()

Parameters

None.

Returns

A copy of the object node.

Throws

ObjectException

dropSecondaryObject

Description

This method removes a child object associated with the parent object (in the memory copy of the object). The object node passed in as the parameter defines the child object type. Use this method to remove a child object before it has been committed to the database. This method is similar to ObjectNode.removeChild. Use ObjectNode.deleteChild to remove the child object permanently from the database.

Syntax


void dropSecondaryObject(ObjectNode obj)

Parameters

Name 

Type 

Description 

obj 

ObjectNode 

An ObjectNode representing the child object to drop from the parent object. 

Returns

None.

Throws

SystemObjectException

getObjectNameId

Description

This method retrieves the unique identification code (primary key) of the object, as assigned by the master index application.

Syntax


String getObjectNameId()

Parameters

None.

Returns

A string containing the unique ID of the parent object.

Throws

ObjectException

getChild

Description

This method retrieves all child objects associated with the parent object that are of the type specified in the method name. For example, to retrieve all address objects associated with a parent object, call getAddress.

Syntax


Collection getChild()

Parameters

None.

Returns

A collection of child objects of the type specified in the method name.

Throws

None.

getField

Description

This method retrieves the value of the field specified in the method name. Each getter method is named according to the fields defined for the parent object. For example, if the parent object contains a field named FirstName, the getter method for this field is named getFirstName.

Syntax


String getField()

Note –

The syntax for the getter methods depends on the type of data specified for the field in the object structure. For example, the getter method for a date field would have the following syntax:


 Date getField

Parameters

None.

Returns

The value of the specified field. The type of data returned depends on the data type defined in the object definition.

Throws

ObjectException

getChildTags

Description

This method retrieves a list of the names of all child object types defined for the object structure.

Syntax


ArrayList getChildTags()

Parameters

None.

Returns

An array of child object names.

Throws

None.

getMetaData

Description

This method retrieves the metadata for the parent object.

Syntax


AttributeMetaData getMetaData()

Parameters

None.

Returns

An AttributeMetaData object containing the parent object’s metadata.

Throws

None.

getSecondaryObject

Description

This method retrieves all child objects that are associated with the parent object and are of the specified type.

Syntax


Collection getSecondaryObject(String type)

Parameters

Name 

Type 

Description 

type 

String 

The child type of the objects to retrieve. 

Returns

A collection of child objects of the specified type.

Throws

SystemObjectException

isAdded

Description

This method retrieves the value of the “add flag” for the parent object. The add flag indicates whether the object will be added.

Syntax


String isAdded()

Parameters

None.

Returns

A Boolean value indicating whether the add flag is set to true or false.

Throws

ObjectException

isRemoved

Description

This method retrieves the value of the “remove flag” for the parent object. The remove flag indicates whether the object will be removed.

Syntax


String isRemoved()

Parameters

None.

Returns

A Boolean value indicating whether the remove flag is set to true or false.

Throws

ObjectException

isUpdated

Description

This method retrieves the value of the “update flag” for the parent object. The update flag indicates whether the object will be updated.

Syntax


String isUpdated()

Parameters

None.

Returns

A Boolean value indicating whether the update flag is set to true or false.

Throws

ObjectException

setObjectNameId

Description

This method sets the value of the ObjectNameId field in the parent object.

Syntax


void setObjectNameId(Object value)

Parameters

Name 

Type 

Description 

value 

Object 

An object containing the value of the ObjectNameId field.

Returns

None.

Throws

ObjectException

setField

Description

This method sets the value of the field specified in the method name. Each setter method is named according to the fields defined for the parent object. For example, if the parent object contains a field named “DateOfBirth”, the setter method for this field is named setDateOfBirth. A setter method is created for each field in the parent object, including any fields containing standardized or phonetic data.

Syntax


void setField(Object value)

Parameters

Name 

Type 

Description 

value 

Object 

An object containing the value of the field specified by the method name. 

Returns

None.

Throws

ObjectException

setAddFlag

Description

This method sets the “add flag” of the parent object. The add flag indicates whether the object will be added.

Syntax


void setAddFlag(boolean flag)

Parameters

Name 

Type 

Description 

flag 

Boolean 

An indicator of whether the add flag is set to true or false. 

Returns

None.

Throws

None.

setRemoveFlag

Description

This method sets the “remove flag” of the parent object. The remove flag indicates whether the object will be removed.

Syntax


void setRemoveFlag(boolean e)

Parameters

Name 

Type 

Description 

Boolean 

An indicator of whether the remove flag is set to true or false. 

Returns

None.

Throws

None.

setUpdateFlag

Description

This method sets the “update flag” of the parent object. The update flag indicates whether the object will be updated.

Syntax


void setUpdateFlag(boolean flag)

Parameters

Name 

Type 

Description 

flag 

Boolean 

An indicator of whether the update flag is set to true or false. 

Returns

None.

Throws

None.

structCopy

Description

This method copies the structure of the specified object node.

Syntax


ObjectNode structCopy()

Parameters

None.

Returns

A copy of the structure of the object node.

Throws

ObjectException