Understanding Sun Master Index Processing

Child Beans

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

The name of each child object JavaBean class is the same as the name of each child object, with the word “Bean” appended. For example, if a child object in your object structure is named “Address”, the name of the corresponding child class is AddressBean. The methods in this class include a constructor method for the child object JavaBean, and get and set methods for each field defined for the child object. Most methods have dynamic names based on the name of the child object and the fields defined for that object. In the following methods, Child indicates the name of a child object and Field indicates the name of a field defined for the child object.

Definition


final class ChildBean

Methods


Note –

These JavaBeans also include two countChildren methods, which are not currently used.


Inherited Methods

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

ChildBean

Description

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

Syntax


new ChildBean()

Parameters

None.

Returns

An instance of the child object Bean.

Throws

ObjectException

delete

Description

This method removes the child object from its corresponding parent object. This is used with the executeMatchUpdate function to update a system object by deleting one of the child objects from the object being processed.

Syntax


void delete()

Parameters

None.

Returns

None.

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 child object. For example, if the child object contains a field named “ZipCode”, the getter method for this field is named getZipCode.

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 structure.

Throws

ObjectException

getChildId

Description

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

Syntax


String getChildId()

Parameters

None.

Returns

A string containing the unique ID of the child object.

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 child object. For example, if the child object contains a field named “Address”, the setter method for this field is named setAddress. A setter method is created for each field in the child 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 data type of the field being populated. 

Returns

None.

Throws

ObjectException

setChildId

Description

This method sets the value of the ChildId field in the child object.


Note –

This ID is set internally by the master index application. You should never set this field manually.


Syntax


void setChildId(String value)

Parameters

Name 

Type 

Description 

value 

String 

The value of the ChildId field.

Returns

None.

Throws

ObjectException