Understanding Sun Master Index Processing (Repository)

Master Index Parent Beans (Repository)

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

The name of each parent object Bean class is the same as the name of each parent object, with the word “Bean” appended. For example, if a parent object in your object structure is “Person”, the name of the associated parent Bean class is “PersonBean”. The methods in this class include a constructor method for the parent object Bean, 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 methods described in this section, 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


final class ObjectNameBean

Methods

 

Inherited Methods

The following methods are inherited from java.lang.Object.

ObjectNameBean

Description

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

Syntax


new ObjectNameBean()

Parameters

None.

Returns

An instance of the parent object Bean.

Throws

ObjectException

countChild

Description

This method returns the total number of child objects contained in a system object. The type of child object is specified by the method name (such as Phone or Address).

Syntax


int countChild()

Parameters

None.

Returns

An integer indicating the number of child objects in a collection.

Throws

None.

countChildren

Description

This method returns a count of the total number of child objects belonging to a system object.

Syntax


int countChildren()

Parameters

None.

Returns

An integer representing the total number of child objects.

Throws

None.

countChildren

Description

This method returns a count of the total number of child objects of a specific type that belong to a system object.

Syntax


int countChildren(String type)

Parameters

Name 

Type 

Description 

type 

String 

The type of child object to count, such as Phone or Address. 

Returns

An integer representing the total number of child objects of the specified type.

Throws

None.

deleteChild

Description

This method removes the specified child object from the system object. The type of child object to remove is specified by the name of the method, and the specific child object to remove is specified by its unique identification code assigned by the master index application.

Syntax


void deleteChild(String ChildId)

Parameters

Name 

Type 

Description 

ChildId

String 

The unique identification code of the child object to delete. 

Returns

None.

Throws

ObjectException

getChild

Description

This method retrieves an array of child object Beans. Each getter method is named according to the child objects defined for the parent object. For example, if the parent object contains a child object named “Address”, the getter method for this field is named getAddress. A getter method is created for each child object in the parent object.

Syntax


ChildBean[] getChild()

Parameters

None.

Returns

An array of Java Beans containing the type of child objects specified by the method name.

Throws

None.

getChild

Description

This method retrieves a child object Bean based on its index in a list of child objects. Each getter method is named according to the child objects defined for the parent object. For example, if the parent object contains a child object named “Address”, the getter method for this field is named getAddress. A getter method is created for each child object in the parent object.

Syntax


ChildBean getChild(int i)

Parameters

Name 

Type 

Description 

int 

The index of the child object to retrieve from a list of child objects. 

Returns

A Java Bean containing the child object specified by the index value. The method name indicates the type of child object returned.

Throws

ObjectException

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

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

setChild

Description

This method adds a child object to the system object.

Syntax


void setChild(int index, ChildBean child)

Parameters

Name 

Type 

Description 

index 

integer 

The index number for the new child object. 

child 

ChildBean

The Java Bean containing the child object to add. 

Returns

None.

Throws

None.

setChild

Description

This method adds an array of child objects of one type to the system object.

Syntax


void setChild(ChildBean[] children)

Parameters

Name 

Type 

Description 

children 

ChildBean[]

The array of child objects to add. 

Returns

None.

Throws

None.

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(value)

Parameters

Name 

Type 

Description 

value 

varies 

The value of the field specified by the method name. The type of value depends on the field being populated. 

Returns

None.

Throws

ObjectException

setObjectNameId

Description

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


Note –

This ID is set internally by the master index application. Do not set this field manually.


Syntax


void setObjectNameId(String value)

Parameters

Name 

Type 

Description 

value 

String 

The value of the ObjectNameId field.

Returns

None.

Throws

ObjectException