All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.ciera.tool.sql.ooaofooa.association.impl.ReferredToClassInAssocImpl Maven / Gradle / Ivy

There is a newer version: 2.7.3
Show newest version
package io.ciera.tool.sql.ooaofooa.association.impl;


import io.ciera.runtime.instanceloading.AttributeChangedDelta;
import io.ciera.runtime.instanceloading.InstanceCreatedDelta;
import io.ciera.runtime.summit.application.IRunContext;
import io.ciera.runtime.summit.classes.IInstanceIdentifier;
import io.ciera.runtime.summit.classes.InstanceIdentifier;
import io.ciera.runtime.summit.classes.ModelInstance;
import io.ciera.runtime.summit.exceptions.EmptyInstanceException;
import io.ciera.runtime.summit.exceptions.InstancePopulationException;
import io.ciera.runtime.summit.exceptions.XtumlException;
import io.ciera.runtime.summit.types.IWhere;
import io.ciera.runtime.summit.types.IXtumlType;
import io.ciera.runtime.summit.types.UniqueId;
import io.ciera.tool.Sql;
import io.ciera.tool.sql.ooaofooa.association.ClassAsAssociatedOneSide;
import io.ciera.tool.sql.ooaofooa.association.ClassAsAssociatedOtherSide;
import io.ciera.tool.sql.ooaofooa.association.ClassAsSimpleParticipant;
import io.ciera.tool.sql.ooaofooa.association.ClassAsSupertype;
import io.ciera.tool.sql.ooaofooa.association.ClassInAssociation;
import io.ciera.tool.sql.ooaofooa.association.ReferredToClassInAssoc;
import io.ciera.tool.sql.ooaofooa.association.impl.ClassAsAssociatedOneSideImpl;
import io.ciera.tool.sql.ooaofooa.association.impl.ClassAsAssociatedOtherSideImpl;
import io.ciera.tool.sql.ooaofooa.association.impl.ClassAsSimpleParticipantImpl;
import io.ciera.tool.sql.ooaofooa.association.impl.ClassAsSupertypeImpl;
import io.ciera.tool.sql.ooaofooa.association.impl.ClassInAssociationImpl;
import io.ciera.tool.sql.ooaofooa.subsystem.ClassIdentifier;
import io.ciera.tool.sql.ooaofooa.subsystem.ReferredToIdentifierAttribute;
import io.ciera.tool.sql.ooaofooa.subsystem.ReferredToIdentifierAttributeSet;
import io.ciera.tool.sql.ooaofooa.subsystem.impl.ClassIdentifierImpl;
import io.ciera.tool.sql.ooaofooa.subsystem.impl.ReferredToIdentifierAttributeSetImpl;


public class ReferredToClassInAssocImpl extends ModelInstance implements ReferredToClassInAssoc {

    public static final String KEY_LETTERS = "R_RTO";
    public static final ReferredToClassInAssoc EMPTY_REFERREDTOCLASSINASSOC = new EmptyReferredToClassInAssoc();

    private Sql context;

    // constructors
    private ReferredToClassInAssocImpl( Sql context ) {
        this.context = context;
        ref_Obj_ID = UniqueId.random();
        ref_Rel_ID = UniqueId.random();
        ref_OIR_ID = UniqueId.random();
        ref_Oid_ID = 0;
        R109_is_identified_in_this_association_by_ClassIdentifier_inst = ClassIdentifierImpl.EMPTY_CLASSIDENTIFIER;
        R110_is_identified_in_this_association_by_ReferredToIdentifierAttribute_set = new ReferredToIdentifierAttributeSetImpl();
        R203_is_a_ClassInAssociation_inst = ClassInAssociationImpl.EMPTY_CLASSINASSOCIATION;
        R204_is_a_ClassAsAssociatedOneSide_inst = ClassAsAssociatedOneSideImpl.EMPTY_CLASSASASSOCIATEDONESIDE;
        R204_is_a_ClassAsAssociatedOtherSide_inst = ClassAsAssociatedOtherSideImpl.EMPTY_CLASSASASSOCIATEDOTHERSIDE;
        R204_is_a_ClassAsSimpleParticipant_inst = ClassAsSimpleParticipantImpl.EMPTY_CLASSASSIMPLEPARTICIPANT;
        R204_is_a_ClassAsSupertype_inst = ClassAsSupertypeImpl.EMPTY_CLASSASSUPERTYPE;
    }

    private ReferredToClassInAssocImpl( Sql context, UniqueId instanceId, UniqueId ref_Obj_ID, UniqueId ref_Rel_ID, UniqueId ref_OIR_ID, int ref_Oid_ID ) {
        super(instanceId);
        this.context = context;
        this.ref_Obj_ID = ref_Obj_ID;
        this.ref_Rel_ID = ref_Rel_ID;
        this.ref_OIR_ID = ref_OIR_ID;
        this.ref_Oid_ID = ref_Oid_ID;
        R109_is_identified_in_this_association_by_ClassIdentifier_inst = ClassIdentifierImpl.EMPTY_CLASSIDENTIFIER;
        R110_is_identified_in_this_association_by_ReferredToIdentifierAttribute_set = new ReferredToIdentifierAttributeSetImpl();
        R203_is_a_ClassInAssociation_inst = ClassInAssociationImpl.EMPTY_CLASSINASSOCIATION;
        R204_is_a_ClassAsAssociatedOneSide_inst = ClassAsAssociatedOneSideImpl.EMPTY_CLASSASASSOCIATEDONESIDE;
        R204_is_a_ClassAsAssociatedOtherSide_inst = ClassAsAssociatedOtherSideImpl.EMPTY_CLASSASASSOCIATEDOTHERSIDE;
        R204_is_a_ClassAsSimpleParticipant_inst = ClassAsSimpleParticipantImpl.EMPTY_CLASSASSIMPLEPARTICIPANT;
        R204_is_a_ClassAsSupertype_inst = ClassAsSupertypeImpl.EMPTY_CLASSASSUPERTYPE;
    }

    public static ReferredToClassInAssoc create( Sql context ) throws XtumlException {
        ReferredToClassInAssoc newReferredToClassInAssoc = new ReferredToClassInAssocImpl( context );
        if ( context.addInstance( newReferredToClassInAssoc ) ) {
            newReferredToClassInAssoc.getRunContext().addChange(new InstanceCreatedDelta(newReferredToClassInAssoc, KEY_LETTERS));
            return newReferredToClassInAssoc;
        }
        else throw new InstancePopulationException( "Instance already exists within this population." );
    }

    public static ReferredToClassInAssoc create( Sql context, UniqueId ref_Obj_ID, UniqueId ref_Rel_ID, UniqueId ref_OIR_ID, int ref_Oid_ID ) throws XtumlException {
        return create(context, UniqueId.random(), ref_Obj_ID, ref_Rel_ID, ref_OIR_ID, ref_Oid_ID);
    }

    public static ReferredToClassInAssoc create( Sql context, UniqueId instanceId, UniqueId ref_Obj_ID, UniqueId ref_Rel_ID, UniqueId ref_OIR_ID, int ref_Oid_ID ) throws XtumlException {
        ReferredToClassInAssoc newReferredToClassInAssoc = new ReferredToClassInAssocImpl( context, instanceId, ref_Obj_ID, ref_Rel_ID, ref_OIR_ID, ref_Oid_ID );
        if ( context.addInstance( newReferredToClassInAssoc ) ) {
            return newReferredToClassInAssoc;
        }
        else throw new InstancePopulationException( "Instance already exists within this population." );
    }



    // attributes
    private UniqueId ref_Obj_ID;
    @Override
    public UniqueId getObj_ID() throws XtumlException {
        checkLiving();
        return ref_Obj_ID;
    }
    @Override
    public void setObj_ID(UniqueId ref_Obj_ID) throws XtumlException {
        checkLiving();
        if (ref_Obj_ID.inequality( this.ref_Obj_ID)) {
            final UniqueId oldValue = this.ref_Obj_ID;
            this.ref_Obj_ID = ref_Obj_ID;
            getRunContext().addChange(new AttributeChangedDelta(this, KEY_LETTERS, "ref_Obj_ID", oldValue, this.ref_Obj_ID));
            if ( !R110_is_identified_in_this_association_by_ReferredToIdentifierAttribute().isEmpty() ) R110_is_identified_in_this_association_by_ReferredToIdentifierAttribute().setObj_ID( ref_Obj_ID );
            if ( !R204_is_a_ClassAsAssociatedOtherSide().isEmpty() ) R204_is_a_ClassAsAssociatedOtherSide().setObj_ID( ref_Obj_ID );
            if ( !R204_is_a_ClassAsSimpleParticipant().isEmpty() ) R204_is_a_ClassAsSimpleParticipant().setObj_ID( ref_Obj_ID );
            if ( !R204_is_a_ClassAsAssociatedOneSide().isEmpty() ) R204_is_a_ClassAsAssociatedOneSide().setObj_ID( ref_Obj_ID );
            if ( !R204_is_a_ClassAsSupertype().isEmpty() ) R204_is_a_ClassAsSupertype().setObj_ID( ref_Obj_ID );
        }
    }
    private UniqueId ref_Rel_ID;
    @Override
    public UniqueId getRel_ID() throws XtumlException {
        checkLiving();
        return ref_Rel_ID;
    }
    @Override
    public void setRel_ID(UniqueId ref_Rel_ID) throws XtumlException {
        checkLiving();
        if (ref_Rel_ID.inequality( this.ref_Rel_ID)) {
            final UniqueId oldValue = this.ref_Rel_ID;
            this.ref_Rel_ID = ref_Rel_ID;
            getRunContext().addChange(new AttributeChangedDelta(this, KEY_LETTERS, "ref_Rel_ID", oldValue, this.ref_Rel_ID));
            if ( !R110_is_identified_in_this_association_by_ReferredToIdentifierAttribute().isEmpty() ) R110_is_identified_in_this_association_by_ReferredToIdentifierAttribute().setRel_ID( ref_Rel_ID );
            if ( !R204_is_a_ClassAsAssociatedOtherSide().isEmpty() ) R204_is_a_ClassAsAssociatedOtherSide().setRel_ID( ref_Rel_ID );
            if ( !R204_is_a_ClassAsAssociatedOneSide().isEmpty() ) R204_is_a_ClassAsAssociatedOneSide().setRel_ID( ref_Rel_ID );
            if ( !R204_is_a_ClassAsSupertype().isEmpty() ) R204_is_a_ClassAsSupertype().setRel_ID( ref_Rel_ID );
            if ( !R204_is_a_ClassAsSimpleParticipant().isEmpty() ) R204_is_a_ClassAsSimpleParticipant().setRel_ID( ref_Rel_ID );
        }
    }
    private UniqueId ref_OIR_ID;
    @Override
    public void setOIR_ID(UniqueId ref_OIR_ID) throws XtumlException {
        checkLiving();
        if (ref_OIR_ID.inequality( this.ref_OIR_ID)) {
            final UniqueId oldValue = this.ref_OIR_ID;
            this.ref_OIR_ID = ref_OIR_ID;
            getRunContext().addChange(new AttributeChangedDelta(this, KEY_LETTERS, "ref_OIR_ID", oldValue, this.ref_OIR_ID));
            if ( !R204_is_a_ClassAsAssociatedOtherSide().isEmpty() ) R204_is_a_ClassAsAssociatedOtherSide().setOIR_ID( ref_OIR_ID );
            if ( !R204_is_a_ClassAsSupertype().isEmpty() ) R204_is_a_ClassAsSupertype().setOIR_ID( ref_OIR_ID );
            if ( !R204_is_a_ClassAsSimpleParticipant().isEmpty() ) R204_is_a_ClassAsSimpleParticipant().setOIR_ID( ref_OIR_ID );
            if ( !R204_is_a_ClassAsAssociatedOneSide().isEmpty() ) R204_is_a_ClassAsAssociatedOneSide().setOIR_ID( ref_OIR_ID );
            if ( !R110_is_identified_in_this_association_by_ReferredToIdentifierAttribute().isEmpty() ) R110_is_identified_in_this_association_by_ReferredToIdentifierAttribute().setOIR_ID( ref_OIR_ID );
        }
    }
    @Override
    public UniqueId getOIR_ID() throws XtumlException {
        checkLiving();
        return ref_OIR_ID;
    }
    private int ref_Oid_ID;
    @Override
    public void setOid_ID(int ref_Oid_ID) throws XtumlException {
        checkLiving();
        if (ref_Oid_ID != this.ref_Oid_ID) {
            final int oldValue = this.ref_Oid_ID;
            this.ref_Oid_ID = ref_Oid_ID;
            getRunContext().addChange(new AttributeChangedDelta(this, KEY_LETTERS, "ref_Oid_ID", oldValue, this.ref_Oid_ID));
            if ( !R110_is_identified_in_this_association_by_ReferredToIdentifierAttribute().isEmpty() ) R110_is_identified_in_this_association_by_ReferredToIdentifierAttribute().setOid_ID( ref_Oid_ID );
        }
    }
    @Override
    public int getOid_ID() throws XtumlException {
        checkLiving();
        return ref_Oid_ID;
    }


    // instance identifiers
    @Override
    public IInstanceIdentifier getId1() {
        try {
            return new InstanceIdentifier(getObj_ID(), getRel_ID(), getOIR_ID());
        }
        catch ( XtumlException e ) {
            getRunContext().getLog().error(e);
            System.exit(1);
            return null;
        }
    }
    @Override
    public IInstanceIdentifier getId2() {
        try {
            return new InstanceIdentifier(getObj_ID(), getRel_ID(), getOIR_ID(), getOid_ID());
        }
        catch ( XtumlException e ) {
            getRunContext().getLog().error(e);
            System.exit(1);
            return null;
        }
    }

    // operations


    // static operations


    // events


    // selections
    private ClassIdentifier R109_is_identified_in_this_association_by_ClassIdentifier_inst;
    @Override
    public void setR109_is_identified_in_this_association_by_ClassIdentifier( ClassIdentifier inst ) {
        R109_is_identified_in_this_association_by_ClassIdentifier_inst = inst;
    }
    @Override
    public ClassIdentifier R109_is_identified_in_this_association_by_ClassIdentifier() throws XtumlException {
        return R109_is_identified_in_this_association_by_ClassIdentifier_inst;
    }
    private ReferredToIdentifierAttributeSet R110_is_identified_in_this_association_by_ReferredToIdentifierAttribute_set;
    @Override
    public void addR110_is_identified_in_this_association_by_ReferredToIdentifierAttribute( ReferredToIdentifierAttribute inst ) {
        R110_is_identified_in_this_association_by_ReferredToIdentifierAttribute_set.add(inst);
    }
    @Override
    public void removeR110_is_identified_in_this_association_by_ReferredToIdentifierAttribute( ReferredToIdentifierAttribute inst ) {
        R110_is_identified_in_this_association_by_ReferredToIdentifierAttribute_set.remove(inst);
    }
    @Override
    public ReferredToIdentifierAttributeSet R110_is_identified_in_this_association_by_ReferredToIdentifierAttribute() throws XtumlException {
        return R110_is_identified_in_this_association_by_ReferredToIdentifierAttribute_set;
    }
    private ClassInAssociation R203_is_a_ClassInAssociation_inst;
    @Override
    public void setR203_is_a_ClassInAssociation( ClassInAssociation inst ) {
        R203_is_a_ClassInAssociation_inst = inst;
    }
    @Override
    public ClassInAssociation R203_is_a_ClassInAssociation() throws XtumlException {
        return R203_is_a_ClassInAssociation_inst;
    }
    private ClassAsAssociatedOneSide R204_is_a_ClassAsAssociatedOneSide_inst;
    @Override
    public void setR204_is_a_ClassAsAssociatedOneSide( ClassAsAssociatedOneSide inst ) {
        R204_is_a_ClassAsAssociatedOneSide_inst = inst;
    }
    @Override
    public ClassAsAssociatedOneSide R204_is_a_ClassAsAssociatedOneSide() throws XtumlException {
        return R204_is_a_ClassAsAssociatedOneSide_inst;
    }
    private ClassAsAssociatedOtherSide R204_is_a_ClassAsAssociatedOtherSide_inst;
    @Override
    public void setR204_is_a_ClassAsAssociatedOtherSide( ClassAsAssociatedOtherSide inst ) {
        R204_is_a_ClassAsAssociatedOtherSide_inst = inst;
    }
    @Override
    public ClassAsAssociatedOtherSide R204_is_a_ClassAsAssociatedOtherSide() throws XtumlException {
        return R204_is_a_ClassAsAssociatedOtherSide_inst;
    }
    private ClassAsSimpleParticipant R204_is_a_ClassAsSimpleParticipant_inst;
    @Override
    public void setR204_is_a_ClassAsSimpleParticipant( ClassAsSimpleParticipant inst ) {
        R204_is_a_ClassAsSimpleParticipant_inst = inst;
    }
    @Override
    public ClassAsSimpleParticipant R204_is_a_ClassAsSimpleParticipant() throws XtumlException {
        return R204_is_a_ClassAsSimpleParticipant_inst;
    }
    private ClassAsSupertype R204_is_a_ClassAsSupertype_inst;
    @Override
    public void setR204_is_a_ClassAsSupertype( ClassAsSupertype inst ) {
        R204_is_a_ClassAsSupertype_inst = inst;
    }
    @Override
    public ClassAsSupertype R204_is_a_ClassAsSupertype() throws XtumlException {
        return R204_is_a_ClassAsSupertype_inst;
    }


    @Override
    public IRunContext getRunContext() {
        return context().getRunContext();
    }

    @Override
    public Sql context() {
        return context;
    }

    @Override
    public String getKeyLetters() {
        return KEY_LETTERS;
    }

    @Override
    public ReferredToClassInAssoc self() {
        return this;
    }

    @Override
    public ReferredToClassInAssoc oneWhere(IWhere condition) throws XtumlException {
        if (null == condition) throw new XtumlException("Null condition passed to selection.");
        if (condition.evaluate(this)) return this;
        else return EMPTY_REFERREDTOCLASSINASSOC;
    }

}

class EmptyReferredToClassInAssoc extends ModelInstance implements ReferredToClassInAssoc {

    // attributes
    public UniqueId getObj_ID() throws XtumlException {
        throw new EmptyInstanceException( "Cannot get attribute of empty instance." );
    }
    public void setObj_ID( UniqueId ref_Obj_ID ) throws XtumlException {
        throw new EmptyInstanceException( "Cannot set attribute of empty instance." );
    }
    public UniqueId getRel_ID() throws XtumlException {
        throw new EmptyInstanceException( "Cannot get attribute of empty instance." );
    }
    public void setRel_ID( UniqueId ref_Rel_ID ) throws XtumlException {
        throw new EmptyInstanceException( "Cannot set attribute of empty instance." );
    }
    public void setOIR_ID( UniqueId ref_OIR_ID ) throws XtumlException {
        throw new EmptyInstanceException( "Cannot set attribute of empty instance." );
    }
    public UniqueId getOIR_ID() throws XtumlException {
        throw new EmptyInstanceException( "Cannot get attribute of empty instance." );
    }
    public void setOid_ID( int ref_Oid_ID ) throws XtumlException {
        throw new EmptyInstanceException( "Cannot set attribute of empty instance." );
    }
    public int getOid_ID() throws XtumlException {
        throw new EmptyInstanceException( "Cannot get attribute of empty instance." );
    }


    // operations


    // selections
    @Override
    public ClassIdentifier R109_is_identified_in_this_association_by_ClassIdentifier() {
        return ClassIdentifierImpl.EMPTY_CLASSIDENTIFIER;
    }
    @Override
    public ReferredToIdentifierAttributeSet R110_is_identified_in_this_association_by_ReferredToIdentifierAttribute() {
        return (new ReferredToIdentifierAttributeSetImpl());
    }
    @Override
    public ClassInAssociation R203_is_a_ClassInAssociation() {
        return ClassInAssociationImpl.EMPTY_CLASSINASSOCIATION;
    }
    @Override
    public ClassAsAssociatedOneSide R204_is_a_ClassAsAssociatedOneSide() {
        return ClassAsAssociatedOneSideImpl.EMPTY_CLASSASASSOCIATEDONESIDE;
    }
    @Override
    public ClassAsAssociatedOtherSide R204_is_a_ClassAsAssociatedOtherSide() {
        return ClassAsAssociatedOtherSideImpl.EMPTY_CLASSASASSOCIATEDOTHERSIDE;
    }
    @Override
    public ClassAsSimpleParticipant R204_is_a_ClassAsSimpleParticipant() {
        return ClassAsSimpleParticipantImpl.EMPTY_CLASSASSIMPLEPARTICIPANT;
    }
    @Override
    public ClassAsSupertype R204_is_a_ClassAsSupertype() {
        return ClassAsSupertypeImpl.EMPTY_CLASSASSUPERTYPE;
    }


    @Override
    public String getKeyLetters() {
        return ReferredToClassInAssocImpl.KEY_LETTERS;
    }

    @Override
    public ReferredToClassInAssoc self() {
        return this;
    }

    @Override
    public boolean isEmpty() {
        return true;
    }

    @Override
    public ReferredToClassInAssoc oneWhere(IWhere condition) throws XtumlException {
        if (null == condition) throw new XtumlException("Null condition passed to selection.");
        return ReferredToClassInAssocImpl.EMPTY_REFERREDTOCLASSINASSOC;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy