/* Generated by JSDAI Express Compiler, version 3.5, build 225, 2003-04-23 */

// Java class implementing entity second_entity

package jsdai.SExample_2;
import jsdai.lang.*;

public class CSecond_entity extends jsdai.SExample_1.CFirst_entity implements ESecond_entity {
	public static final jsdai.dictionary.CEntity_definition definition = initEntityDefinition(CSecond_entity.class, SExample_2.ss);

	/*----------------------------- Attributes -----------*/

	// attr_1: protected int a0;   attr_1 - java inheritance - INTEGER
	protected String a1; // attr_2 - current entity - STRING
	protected static final jsdai.dictionary.CExplicit_attribute a1$ = CEntity.initExplicitAttribute(definition, 1);

	public jsdai.dictionary.EEntity_definition getInstanceType() {
		return definition;
	}

	protected void changeReferences(InverseEntity old, InverseEntity newer) throws SdaiException {
		super.changeReferences(old, newer);
	}

	/*----------- Methods for attribute access -----------*/

	/// methods for attribute: attr_2, base type: STRING
	public boolean testAttr_2(ESecond_entity type) throws SdaiException {
		return test_string(a1);
	}
	public String getAttr_2(ESecond_entity type) throws SdaiException {
		return get_string(a1);
	}
	public void setAttr_2(ESecond_entity type, String value) throws SdaiException {
		a1 = set_string(value);
	}
	public void unsetAttr_2(ESecond_entity type) throws SdaiException {
		a1 = unset_string();
	}
	public static jsdai.dictionary.EAttribute attributeAttr_2(ESecond_entity type) throws SdaiException {
		return a1$;
	}


	/*---------------------- setAll() --------------------*/

	protected void setAll(ComplexEntityValue av) throws SdaiException {
		if (av == null) {
			a0 = Integer.MIN_VALUE;
			a1 = null;
			return;
		}
		a0 = av.entityValues[0].getInteger(0);
		a1 = av.entityValues[1].getString(0);
	}

	/*---------------------- getAll() --------------------*/

	protected void getAll(ComplexEntityValue av) throws SdaiException {
		// partial entity: first_entity
		av.entityValues[0].setInteger(0, a0);
		// partial entity: second_entity
		av.entityValues[1].setString(0, a1);
	}
}
