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

klass.model.meta.domain.ClassifierInterfaceMappingAbstract Maven / Gradle / Ivy

The newest version!
package klass.model.meta.domain;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.*;
import java.io.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.gs.fw.common.mithra.*;
import com.gs.fw.common.mithra.attribute.*;
import com.gs.fw.common.mithra.util.*;
import com.gs.fw.common.mithra.notification.*;
import com.gs.fw.common.mithra.notification.listener.*;
import com.gs.fw.common.mithra.list.cursor.Cursor;
import com.gs.fw.common.mithra.bulkloader.*;
import com.gs.fw.common.mithra.*;
import com.gs.fw.common.mithra.behavior.*;
import com.gs.fw.common.mithra.cache.Cache;
import com.gs.fw.common.mithra.extractor.*;
import com.gs.fw.common.mithra.finder.*;
import com.gs.fw.common.mithra.list.*;
import com.gs.fw.common.mithra.behavior.state.PersistenceState;
import com.gs.fw.common.mithra.attribute.update.*;
import com.gs.fw.common.mithra.transaction.MithraObjectPersister;
import java.util.Arrays;
import java.util.HashSet;
/**
* This file was automatically generated using Mithra 18.0.0. Please do not modify it.
* Add custom logic to its subclass instead.
*/
// Generated from templates/transactional/Abstract.jsp
public abstract class ClassifierInterfaceMappingAbstract extends com.gs.fw.common.mithra.superclassimpl.MithraTransactionalObjectImpl
{
	private static byte MEMORY_STATE = PersistenceState.IN_MEMORY;
	private static byte PERSISTED_STATE = PersistenceState.PERSISTED;
	private static final Logger logger = LoggerFactory.getLogger(ClassifierInterfaceMapping.class.getName());
	private static final RelationshipHashStrategy forsuperInterface = new SuperInterfaceRhs();
	private static final RelationshipHashStrategy forsubClassifier = new SubClassifierRhs();
	private static final class SuperInterfaceRhs implements RelationshipHashStrategy
	{
		public boolean equalsForRelationship(Object _srcObject, Object _srcData, Object _targetData, Timestamp _asOfDate0, Timestamp _asOfDate1)
		{
			ClassifierInterfaceMappingData _castedSrcData = (ClassifierInterfaceMappingData) _srcData;
			InterfaceData _castedTargetData = (InterfaceData) _targetData;
			if (_castedSrcData.getInterfaceName()!= null && _castedSrcData.getInterfaceName().equals(_castedTargetData.getName()))
			{
				return true;
			}

			return false;
		}

		public int computeHashCodeFromRelated(Object _srcObject, Object _srcData)
		{
			ClassifierInterfaceMappingData _castedSrcData = (ClassifierInterfaceMappingData) _srcData;
			return HashUtil.hash(_castedSrcData.getInterfaceName());
		}

		public int computeOffHeapHashCodeFromRelated(Object _srcObject, Object _srcData)
		{
			ClassifierInterfaceMappingData _castedSrcData = (ClassifierInterfaceMappingData) _srcData;
			return HashUtil.offHeapHash(_castedSrcData.getInterfaceName());
		}
	}

	private static final class SubClassifierRhs implements RelationshipHashStrategy
	{
		public boolean equalsForRelationship(Object _srcObject, Object _srcData, Object _targetData, Timestamp _asOfDate0, Timestamp _asOfDate1)
		{
			ClassifierInterfaceMappingData _castedSrcData = (ClassifierInterfaceMappingData) _srcData;
			ClassifierData _castedTargetData = (ClassifierData) _targetData;
			if (_castedSrcData.getClassifierName()!= null && _castedSrcData.getClassifierName().equals(_castedTargetData.getName()))
			{
				return true;
			}

			return false;
		}

		public int computeHashCodeFromRelated(Object _srcObject, Object _srcData)
		{
			ClassifierInterfaceMappingData _castedSrcData = (ClassifierInterfaceMappingData) _srcData;
			return HashUtil.hash(_castedSrcData.getClassifierName());
		}

		public int computeOffHeapHashCodeFromRelated(Object _srcObject, Object _srcData)
		{
			ClassifierInterfaceMappingData _castedSrcData = (ClassifierInterfaceMappingData) _srcData;
			return HashUtil.offHeapHash(_castedSrcData.getClassifierName());
		}
	}

	public ClassifierInterfaceMappingAbstract()
	{
		this.persistenceState = MEMORY_STATE;
	}

	public ClassifierInterfaceMapping getDetachedCopy() throws MithraBusinessException
	{
		return (ClassifierInterfaceMapping) super.getDetachedCopy();
	}

	public ClassifierInterfaceMapping getNonPersistentCopy() throws MithraBusinessException
	{
		ClassifierInterfaceMapping result = (ClassifierInterfaceMapping) super.getNonPersistentCopy();
		result.persistenceState = MEMORY_STATE;
		return result;
	}

	public ClassifierInterfaceMapping copyDetachedValuesToOriginalOrInsertIfNew()
	{
		return (ClassifierInterfaceMapping) this.zCopyDetachedValuesToOriginalOrInsertIfNew();
	}

	public ClassifierInterfaceMapping zFindOriginal()
	{
		ClassifierInterfaceMappingData data = (ClassifierInterfaceMappingData) this.currentData;
		Operation op;
		op = ClassifierInterfaceMappingFinder.classifierName().eq(data.getClassifierName());
		op = op.and(ClassifierInterfaceMappingFinder.interfaceName().eq(data.getInterfaceName()));
		return ClassifierInterfaceMappingFinder.findOne(op);
	}

	public boolean isModifiedSinceDetachmentByDependentRelationships()
	{
		if(this.isModifiedSinceDetachment()) return true;
		return false;
	}

	private Logger getLogger()
	{
		return logger;
	}

	public MithraDataObject zAllocateData()
	{
		return new ClassifierInterfaceMappingData();
	}

	protected void zSetFromClassifierInterfaceMappingData( ClassifierInterfaceMappingData data )
	{
		super.zSetData(data);
		this.persistenceState = PERSISTED_STATE;
	}

	public void setFromClassifierInterfaceMappingData( ClassifierInterfaceMappingData data )
	{
		super.zSetData(data);
	}

	public void zWriteDataClassName(ObjectOutput out) throws IOException
	{
	}

	public final boolean isClassifierNameNull()
	{
		return ((ClassifierInterfaceMappingData) this.zSynchronizedGetData()).isClassifierNameNull();
	}

	public final String getClassifierName()
	{
		ClassifierInterfaceMappingData data = (ClassifierInterfaceMappingData) this.zSynchronizedGetData();
		return data.getClassifierName();
	}

	public void setClassifierName(String newValue)
	{
		if (newValue != null && newValue.length() > 256)
		throw new MithraBusinessException("Attribute 'classifierName' cannot exceed maximum length of 256: " + newValue);
		zSetString(ClassifierInterfaceMappingFinder.classifierName(), newValue, true, false );
	}

	public final boolean isInterfaceNameNull()
	{
		return ((ClassifierInterfaceMappingData) this.zSynchronizedGetData()).isInterfaceNameNull();
	}

	public final String getInterfaceName()
	{
		ClassifierInterfaceMappingData data = (ClassifierInterfaceMappingData) this.zSynchronizedGetData();
		return data.getInterfaceName();
	}

	public void setInterfaceName(String newValue)
	{
		if (newValue != null && newValue.length() > 256)
		throw new MithraBusinessException("Attribute 'interfaceName' cannot exceed maximum length of 256: " + newValue);
		zSetString(ClassifierInterfaceMappingFinder.interfaceName(), newValue, true, false );
	}

	public boolean isOrdinalNull()
	{
		return ((ClassifierInterfaceMappingData) this.zSynchronizedGetData()).isOrdinalNull();
	}

	public int getOrdinal()
	{
		ClassifierInterfaceMappingData data = (ClassifierInterfaceMappingData) this.zSynchronizedGetData();
		return data.getOrdinal();
	}

	public void setOrdinal(int newValue)
	{
		zSetInteger(ClassifierInterfaceMappingFinder.ordinal(), newValue, false, false ,false);
	}

	protected void issuePrimitiveNullSetters(TransactionalBehavior behavior, MithraDataObject data)
	{
	}

	public void zPersistDetachedRelationships(MithraDataObject _data)
	{
		ClassifierInterfaceMappingData _newData = (ClassifierInterfaceMappingData) _data;
	}

	public void zSetTxDetachedDeleted()
	{
		TransactionalBehavior _behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary();
		if (_behavior.isDetached() && _behavior.isDeleted()) return;
		ClassifierInterfaceMappingData _newData = (ClassifierInterfaceMappingData) _behavior.getCurrentDataForRead(this);
		this.zSetTxPersistenceState(PersistenceState.DETACHED_DELETED);
	}

	public void zSetNonTxDetachedDeleted()
	{
		TransactionalBehavior _behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary();
		ClassifierInterfaceMappingData _newData = (ClassifierInterfaceMappingData) _behavior.getCurrentDataForRead(this);
		this.zSetNonTxPersistenceState(PersistenceState.DETACHED_DELETED);
	}

	/**
	* Relationship Expression:
	this.interfaceName = Interface.name
* @see Interface#getSubClassifiers() reverse relationship Interface.getSubClassifiers() * @return The super interface */ public Interface getSuperInterface() { Interface _result = null; Operation _op = null; TransactionalBehavior _behavior = zGetTransactionalBehaviorForReadWithWaitIfNecessary(); ClassifierInterfaceMappingData _data = (ClassifierInterfaceMappingData) _behavior.getCurrentDataForRead(this); MithraObjectPortal _portal = null; if (_behavior.isPersisted()) { { _portal = InterfaceFinder.getMithraObjectPortal(); Object _related = _portal.getAsOneFromCache(this, _data, forsuperInterface, null, null); if (!(_related instanceof NulledRelation)) _result = (Interface) _related; if (_related == null) { _op = InterfaceFinder.name().eq(_data.getInterfaceName()); } } } else if (_behavior.isDetached()) { { { Operation detachedOp = InterfaceFinder.name().eq(_data.getInterfaceName()); _result = InterfaceFinder.zFindOneForRelationship(detachedOp); } } } else if (_behavior.isInMemory()) { _result = (Interface) _data.getSuperInterface(); if (_result == null) { { _op = InterfaceFinder.name().eq(_data.getInterfaceName()); } } } if (_op != null) { _result = InterfaceFinder.zFindOneForRelationship(_op); } return _result; } public void setSuperInterface(Interface superInterface) { Interface _superInterface = (Interface) superInterface; TransactionalBehavior _behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary(); ClassifierInterfaceMappingData _data = (ClassifierInterfaceMappingData) _behavior.getCurrentDataForWrite(this); if (_behavior.isInMemory()) { _data.setSuperInterface(_superInterface); if (_superInterface == null) { this.setInterfaceName(null); } else { this.setInterfaceName(_superInterface.getName()); } } else if (_behavior.isPersisted()) { _behavior.clearTempTransaction(this); if (_superInterface == null) { this.setInterfaceName(null); } else { this.setInterfaceName( _superInterface.getName()); } } else throw new RuntimeException("not implemented"); } /** * Relationship Expression:
	Classifier.name = this.classifierName
* @see Classifier#getSuperInterfaces() reverse relationship Classifier.getSuperInterfaces() * @return The sub classifier */ public Classifier getSubClassifier() { Classifier _result = null; Operation _op = null; TransactionalBehavior _behavior = zGetTransactionalBehaviorForReadWithWaitIfNecessary(); ClassifierInterfaceMappingData _data = (ClassifierInterfaceMappingData) _behavior.getCurrentDataForRead(this); MithraObjectPortal _portal = null; if (_behavior.isPersisted()) { { _portal = ClassifierFinder.getMithraObjectPortal(); Object _related = _portal.getAsOneFromCache(this, _data, forsubClassifier, null, null); if (!(_related instanceof NulledRelation)) _result = (Classifier) _related; if (_related == null) { _op = ClassifierFinder.name().eq(_data.getClassifierName()); } } } else if (_behavior.isDetached()) { if (_data.getSubClassifier() instanceof NulledRelation) { return null; } _result = (Classifier) _data.getSubClassifier(); if (_result == null) { { Operation detachedOp = ClassifierFinder.name().eq(_data.getClassifierName()); _result = ClassifierFinder.zFindOneForRelationship(detachedOp); if(_result != null) { _result = _result.getDetachedCopy(); } } _data = (ClassifierInterfaceMappingData) _behavior.getCurrentDataForWrite(this); _data.setSubClassifier(_result); } } else if (_behavior.isInMemory()) { _result = (Classifier) _data.getSubClassifier(); if (_result == null) { { _op = ClassifierFinder.name().eq(_data.getClassifierName()); } } } if (_op != null) { _result = ClassifierFinder.zFindOneForRelationship(_op); } return _result; } public void setSubClassifier(Classifier subClassifier) { Classifier _subClassifier = (Classifier) subClassifier; TransactionalBehavior _behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary(); ClassifierInterfaceMappingData _data = (ClassifierInterfaceMappingData) _behavior.getCurrentDataForWrite(this); if (_behavior.isInMemory()) { Object _prev = _data.getSubClassifier(); if (_behavior.isDetached() && _prev != null) { ((DelegatingList)((Classifier)_prev).getSuperInterfaces()).zMarkMoved( (ClassifierInterfaceMapping) this); } _data.setSubClassifier(_subClassifier); _subClassifier.getSuperInterfaces().add( (ClassifierInterfaceMapping) this); } else if (_behavior.isPersisted()) { _behavior.clearTempTransaction(this); if (_subClassifier == null) { this.setClassifierName(null); } else { this.setClassifierName( _subClassifier.getName()); } } else throw new RuntimeException("not implemented"); } public void zSetParentContainersubClassifier(ClassifierAbstract parent) { TransactionalBehavior _behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary(); ClassifierInterfaceMappingData _data = (ClassifierInterfaceMappingData) _behavior.getCurrentDataForWrite(this); _behavior.clearTempTransaction(this); if (_behavior.isInMemory()) { _data.setSubClassifier(parent); } } protected void cascadeInsertImpl() throws MithraBusinessException { TransactionalBehavior _behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary(); _behavior.insert(this); } @Override public Map< RelatedFinder, StatisticCounter > zAddNavigatedRelationshipsStats(RelatedFinder finder, Map< RelatedFinder, StatisticCounter > navigationStats) { TransactionalBehavior _behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary(); _behavior.addNavigatedRelationshipsStats(this, finder, navigationStats); return navigationStats; } @Override public Map< RelatedFinder, StatisticCounter > zAddNavigatedRelationshipsStatsForUpdate(RelatedFinder parentFinderGeneric, Map< RelatedFinder, StatisticCounter > navigationStats) { return navigationStats; } @Override public Map< RelatedFinder, StatisticCounter > zAddNavigatedRelationshipsStatsForDelete(RelatedFinder parentFinder, Map< RelatedFinder, StatisticCounter > navigationStats) { return navigationStats; } @Override public ClassifierInterfaceMapping zCascadeCopyThenInsert() throws MithraBusinessException { TransactionalBehavior _behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary(); ClassifierInterfaceMapping original = (ClassifierInterfaceMapping) _behavior.copyThenInsert(this); return original; } protected void cascadeDeleteImpl() throws MithraBusinessException { this.delete(); } public Cache zGetCache() { return ClassifierInterfaceMappingFinder.getMithraObjectPortal().getCache(); } public MithraObjectPortal zGetPortal() { return ClassifierInterfaceMappingFinder.getMithraObjectPortal(); } public ClassifierInterfaceMapping getOriginalPersistentObject() { return this.zFindOriginal(); } protected boolean issueUpdatesForNonPrimaryKeys(TransactionalBehavior behavior, MithraDataObject data, MithraDataObject newData) { boolean changed = false; changed |= zUpdateInteger(behavior, data, newData, ClassifierInterfaceMappingFinder.ordinal(), false); return changed; } protected boolean issueUpdatesForPrimaryKeys(TransactionalBehavior behavior, MithraDataObject data, MithraDataObject newData) { boolean changed = false; changed |= zUpdateString(behavior, data, newData, ClassifierInterfaceMappingFinder.classifierName(), false); changed |= zUpdateString(behavior, data, newData, ClassifierInterfaceMappingFinder.interfaceName(), false); return changed; } public Object readResolve() throws ObjectStreamException { ClassifierInterfaceMappingAbstract result = (ClassifierInterfaceMappingAbstract) super.readResolve(); if (result.persistenceState == PersistenceState.PERSISTED) { result.persistenceState = PERSISTED_STATE; } else if (result.persistenceState == PersistenceState.IN_MEMORY) { result.persistenceState = MEMORY_STATE; } return result; } protected static void zConfigNonTx() { MEMORY_STATE = PersistenceState.IN_MEMORY_NON_TRANSACTIONAL; PERSISTED_STATE = PersistenceState.PERSISTED_NON_TRANSACTIONAL; } protected static void zConfigFullTx() { MEMORY_STATE = PersistenceState.IN_MEMORY; PERSISTED_STATE = PersistenceState.PERSISTED; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy