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

klass.model.meta.domain.OperatorCriteriaAbstract 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 OperatorCriteriaAbstract 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(OperatorCriteria.class.getName());
	private static final RelationshipHashStrategy forsourceExpressionValue = new SourceExpressionValueRhs();
	private static final RelationshipHashStrategy fortargetExpressionValue = new TargetExpressionValueRhs();
	private static final RelationshipHashStrategy forcriteriaSuperClass = new CriteriaSuperClassRhs();
	private static final class SourceExpressionValueRhs implements RelationshipHashStrategy
	{
		public boolean equalsForRelationship(Object _srcObject, Object _srcData, Object _targetData, Timestamp _asOfDate0, Timestamp _asOfDate1)
		{
			OperatorCriteriaData _castedSrcData = (OperatorCriteriaData) _srcData;
			ExpressionValueData _castedTargetData = (ExpressionValueData) _targetData;
			if (_castedSrcData.getSourceExpressionId() == _castedTargetData.getId())
			{
				return true;
			}

			return false;
		}

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

		public int computeOffHeapHashCodeFromRelated(Object _srcObject, Object _srcData)
		{
			return computeHashCodeFromRelated(_srcObject, _srcData);
		}
	}

	private static final class TargetExpressionValueRhs implements RelationshipHashStrategy
	{
		public boolean equalsForRelationship(Object _srcObject, Object _srcData, Object _targetData, Timestamp _asOfDate0, Timestamp _asOfDate1)
		{
			OperatorCriteriaData _castedSrcData = (OperatorCriteriaData) _srcData;
			ExpressionValueData _castedTargetData = (ExpressionValueData) _targetData;
			if (_castedSrcData.getTargetExpressionId() == _castedTargetData.getId())
			{
				return true;
			}

			return false;
		}

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

		public int computeOffHeapHashCodeFromRelated(Object _srcObject, Object _srcData)
		{
			return computeHashCodeFromRelated(_srcObject, _srcData);
		}
	}

	private static final class CriteriaSuperClassRhs implements RelationshipHashStrategy
	{
		public boolean equalsForRelationship(Object _srcObject, Object _srcData, Object _targetData, Timestamp _asOfDate0, Timestamp _asOfDate1)
		{
			OperatorCriteriaData _castedSrcData = (OperatorCriteriaData) _srcData;
			CriteriaData _castedTargetData = (CriteriaData) _targetData;
			if (_castedSrcData.getId() == _castedTargetData.getId())
			{
				return true;
			}

			return false;
		}

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

		public int computeOffHeapHashCodeFromRelated(Object _srcObject, Object _srcData)
		{
			return computeHashCodeFromRelated(_srcObject, _srcData);
		}
	}

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

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

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

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

	public OperatorCriteria zFindOriginal()
	{
		OperatorCriteriaData data = (OperatorCriteriaData) this.currentData;
		Operation op;
		op = OperatorCriteriaFinder.id().eq(data.getId());
		return OperatorCriteriaFinder.findOne(op);
	}

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

	private Logger getLogger()
	{
		return logger;
	}

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

	protected void zSetFromOperatorCriteriaData( OperatorCriteriaData data )
	{
		super.zSetData(data);
		this.persistenceState = PERSISTED_STATE;
	}

	public void setFromOperatorCriteriaData( OperatorCriteriaData data )
	{
		super.zSetData(data);
	}

	public void zWriteDataClassName(ObjectOutput out) throws IOException
	{
	}

	public final boolean isIdNull()
	{
		return ((OperatorCriteriaData) this.zSynchronizedGetData()).isIdNull();
	}

	public final long getId()
	{
		OperatorCriteriaData data = (OperatorCriteriaData) this.zSynchronizedGetData();
		return data.getId();
	}

	public void setId(long newValue)
	{
		zSetLong(OperatorCriteriaFinder.id(), newValue, true, false ,false);
	}

	public boolean isOperatorNull()
	{
		return ((OperatorCriteriaData) this.zSynchronizedGetData()).isOperatorNull();
	}

	public String getOperator()
	{
		OperatorCriteriaData data = (OperatorCriteriaData) this.zSynchronizedGetData();
		return data.getOperator();
	}

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

	public boolean isSourceExpressionIdNull()
	{
		return ((OperatorCriteriaData) this.zSynchronizedGetData()).isSourceExpressionIdNull();
	}

	public long getSourceExpressionId()
	{
		OperatorCriteriaData data = (OperatorCriteriaData) this.zSynchronizedGetData();
		return data.getSourceExpressionId();
	}

	public void setSourceExpressionId(long newValue)
	{
		zSetLong(OperatorCriteriaFinder.sourceExpressionId(), newValue, false, false ,false);
	}

	public boolean isTargetExpressionIdNull()
	{
		return ((OperatorCriteriaData) this.zSynchronizedGetData()).isTargetExpressionIdNull();
	}

	public long getTargetExpressionId()
	{
		OperatorCriteriaData data = (OperatorCriteriaData) this.zSynchronizedGetData();
		return data.getTargetExpressionId();
	}

	public void setTargetExpressionId(long newValue)
	{
		zSetLong(OperatorCriteriaFinder.targetExpressionId(), newValue, false, false ,false);
	}

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

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

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

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

	/**
	* Relationship Expression:
	this.sourceExpressionId = ExpressionValue.id
* @see ExpressionValue#getOperatorCriteriaSourceOf() reverse relationship ExpressionValue.getOperatorCriteriaSourceOf() * @return The source expression value */ public ExpressionValue getSourceExpressionValue() { ExpressionValue _result = null; Operation _op = null; TransactionalBehavior _behavior = zGetTransactionalBehaviorForReadWithWaitIfNecessary(); OperatorCriteriaData _data = (OperatorCriteriaData) _behavior.getCurrentDataForRead(this); MithraObjectPortal _portal = null; if (_behavior.isPersisted()) { { _portal = ExpressionValueFinder.getMithraObjectPortal(); Object _related = _portal.getAsOneFromCache(this, _data, forsourceExpressionValue, null, null); if (!(_related instanceof NulledRelation)) _result = (ExpressionValue) _related; if (_related == null) { _op = ExpressionValueFinder.id().eq(_data.getSourceExpressionId()); } } } else if (_behavior.isDetached()) { { { Operation detachedOp = ExpressionValueFinder.id().eq(_data.getSourceExpressionId()); _result = ExpressionValueFinder.zFindOneForRelationship(detachedOp); } } } else if (_behavior.isInMemory()) { _result = (ExpressionValue) _data.getSourceExpressionValue(); if (_result == null) { { _op = ExpressionValueFinder.id().eq(_data.getSourceExpressionId()); } } } if (_op != null) { _result = ExpressionValueFinder.zFindOneForRelationship(_op); } return _result; } public void setSourceExpressionValue(ExpressionValue sourceExpressionValue) { ExpressionValue _sourceExpressionValue = (ExpressionValue) sourceExpressionValue; TransactionalBehavior _behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary(); OperatorCriteriaData _data = (OperatorCriteriaData) _behavior.getCurrentDataForWrite(this); if (_behavior.isInMemory()) { _data.setSourceExpressionValue(_sourceExpressionValue); if (_sourceExpressionValue == null) { this.setSourceExpressionId(0); } else { this.setSourceExpressionId(_sourceExpressionValue.getId()); } } else if (_behavior.isPersisted()) { _behavior.clearTempTransaction(this); if (_sourceExpressionValue == null) { this.setSourceExpressionId(0); } else { this.setSourceExpressionId( _sourceExpressionValue.getId()); } } else throw new RuntimeException("not implemented"); } /** * Relationship Expression:
	this.targetExpressionId = ExpressionValue.id
* @see ExpressionValue#getOperatorCriteriaTargetOf() reverse relationship ExpressionValue.getOperatorCriteriaTargetOf() * @return The target expression value */ public ExpressionValue getTargetExpressionValue() { ExpressionValue _result = null; Operation _op = null; TransactionalBehavior _behavior = zGetTransactionalBehaviorForReadWithWaitIfNecessary(); OperatorCriteriaData _data = (OperatorCriteriaData) _behavior.getCurrentDataForRead(this); MithraObjectPortal _portal = null; if (_behavior.isPersisted()) { { _portal = ExpressionValueFinder.getMithraObjectPortal(); Object _related = _portal.getAsOneFromCache(this, _data, fortargetExpressionValue, null, null); if (!(_related instanceof NulledRelation)) _result = (ExpressionValue) _related; if (_related == null) { _op = ExpressionValueFinder.id().eq(_data.getTargetExpressionId()); } } } else if (_behavior.isDetached()) { { { Operation detachedOp = ExpressionValueFinder.id().eq(_data.getTargetExpressionId()); _result = ExpressionValueFinder.zFindOneForRelationship(detachedOp); } } } else if (_behavior.isInMemory()) { _result = (ExpressionValue) _data.getTargetExpressionValue(); if (_result == null) { { _op = ExpressionValueFinder.id().eq(_data.getTargetExpressionId()); } } } if (_op != null) { _result = ExpressionValueFinder.zFindOneForRelationship(_op); } return _result; } public void setTargetExpressionValue(ExpressionValue targetExpressionValue) { ExpressionValue _targetExpressionValue = (ExpressionValue) targetExpressionValue; TransactionalBehavior _behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary(); OperatorCriteriaData _data = (OperatorCriteriaData) _behavior.getCurrentDataForWrite(this); if (_behavior.isInMemory()) { _data.setTargetExpressionValue(_targetExpressionValue); if (_targetExpressionValue == null) { this.setTargetExpressionId(0); } else { this.setTargetExpressionId(_targetExpressionValue.getId()); } } else if (_behavior.isPersisted()) { _behavior.clearTempTransaction(this); if (_targetExpressionValue == null) { this.setTargetExpressionId(0); } else { this.setTargetExpressionId( _targetExpressionValue.getId()); } } else throw new RuntimeException("not implemented"); } /** * Relationship Expression:
	Criteria.id = this.id
* @see Criteria#getOperatorCriteriaSubClass() reverse relationship Criteria.getOperatorCriteriaSubClass() * @return The criteria super class */ public Criteria getCriteriaSuperClass() { Criteria _result = null; Operation _op = null; TransactionalBehavior _behavior = zGetTransactionalBehaviorForReadWithWaitIfNecessary(); OperatorCriteriaData _data = (OperatorCriteriaData) _behavior.getCurrentDataForRead(this); MithraObjectPortal _portal = null; if (_behavior.isPersisted()) { { _portal = CriteriaFinder.getMithraObjectPortal(); Object _related = _portal.getAsOneFromCache(this, _data, forcriteriaSuperClass, null, null); if (!(_related instanceof NulledRelation)) _result = (Criteria) _related; if (_related == null) { _op = CriteriaFinder.id().eq(_data.getId()); } } } else if (_behavior.isDetached()) { if (_data.getCriteriaSuperClass() instanceof NulledRelation) { return null; } _result = (Criteria) _data.getCriteriaSuperClass(); if (_result == null) { { Operation detachedOp = CriteriaFinder.id().eq(_data.getId()); _result = CriteriaFinder.zFindOneForRelationship(detachedOp); if(_result != null) { _result = _result.getDetachedCopy(); } } _data = (OperatorCriteriaData) _behavior.getCurrentDataForWrite(this); _data.setCriteriaSuperClass(_result); } } else if (_behavior.isInMemory()) { _result = (Criteria) _data.getCriteriaSuperClass(); if (_result == null) { { _op = CriteriaFinder.id().eq(_data.getId()); } } } if (_op != null) { _result = CriteriaFinder.zFindOneForRelationship(_op); } return _result; } public void setCriteriaSuperClass(Criteria criteriaSuperClass) { ((Criteria)criteriaSuperClass).setOperatorCriteriaSubClass((OperatorCriteria)this); } public void zSetParentContainercriteriaSuperClass(CriteriaAbstract parent) { TransactionalBehavior _behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary(); OperatorCriteriaData _data = (OperatorCriteriaData) _behavior.getCurrentDataForWrite(this); _behavior.clearTempTransaction(this); if (_behavior.isInMemory()) { _data.setCriteriaSuperClass(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 OperatorCriteria zCascadeCopyThenInsert() throws MithraBusinessException { TransactionalBehavior _behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary(); OperatorCriteria original = (OperatorCriteria) _behavior.copyThenInsert(this); return original; } protected void cascadeDeleteImpl() throws MithraBusinessException { this.delete(); } public Cache zGetCache() { return OperatorCriteriaFinder.getMithraObjectPortal().getCache(); } public MithraObjectPortal zGetPortal() { return OperatorCriteriaFinder.getMithraObjectPortal(); } public OperatorCriteria getOriginalPersistentObject() { return this.zFindOriginal(); } protected boolean issueUpdatesForNonPrimaryKeys(TransactionalBehavior behavior, MithraDataObject data, MithraDataObject newData) { boolean changed = false; changed |= zUpdateString(behavior, data, newData, OperatorCriteriaFinder.operator(), false); changed |= zUpdateLong(behavior, data, newData, OperatorCriteriaFinder.sourceExpressionId(), false); changed |= zUpdateLong(behavior, data, newData, OperatorCriteriaFinder.targetExpressionId(), false); return changed; } protected boolean issueUpdatesForPrimaryKeys(TransactionalBehavior behavior, MithraDataObject data, MithraDataObject newData) { boolean changed = false; changed |= zUpdateLong(behavior, data, newData, OperatorCriteriaFinder.id(), false); return changed; } public Object readResolve() throws ObjectStreamException { OperatorCriteriaAbstract result = (OperatorCriteriaAbstract) 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