klass.model.meta.domain.EnumerationPropertyAbstract 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 EnumerationPropertyAbstract 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(EnumerationProperty.class.getName());
private static final RelationshipHashStrategy forenumeration = new EnumerationRhs();
private static final RelationshipHashStrategy fordataTypePropertySuperClass = new DataTypePropertySuperClassRhs();
private static final class EnumerationRhs implements RelationshipHashStrategy
{
public boolean equalsForRelationship(Object _srcObject, Object _srcData, Object _targetData, Timestamp _asOfDate0, Timestamp _asOfDate1)
{
EnumerationPropertyData _castedSrcData = (EnumerationPropertyData) _srcData;
EnumerationData _castedTargetData = (EnumerationData) _targetData;
if (_castedSrcData.getEnumerationName()!= null && _castedSrcData.getEnumerationName().equals(_castedTargetData.getName()))
{
return true;
}
return false;
}
public int computeHashCodeFromRelated(Object _srcObject, Object _srcData)
{
EnumerationPropertyData _castedSrcData = (EnumerationPropertyData) _srcData;
return HashUtil.hash(_castedSrcData.getEnumerationName());
}
public int computeOffHeapHashCodeFromRelated(Object _srcObject, Object _srcData)
{
EnumerationPropertyData _castedSrcData = (EnumerationPropertyData) _srcData;
return HashUtil.offHeapHash(_castedSrcData.getEnumerationName());
}
}
private static final class DataTypePropertySuperClassRhs implements RelationshipHashStrategy
{
public boolean equalsForRelationship(Object _srcObject, Object _srcData, Object _targetData, Timestamp _asOfDate0, Timestamp _asOfDate1)
{
EnumerationPropertyData _castedSrcData = (EnumerationPropertyData) _srcData;
DataTypePropertyData _castedTargetData = (DataTypePropertyData) _targetData;
if (_castedSrcData.getClassifierName()!= null && _castedSrcData.getClassifierName().equals(_castedTargetData.getClassifierName()) && _castedSrcData.getName()!= null && _castedSrcData.getName().equals(_castedTargetData.getName()))
{
return true;
}
return false;
}
public int computeHashCodeFromRelated(Object _srcObject, Object _srcData)
{
EnumerationPropertyData _castedSrcData = (EnumerationPropertyData) _srcData;
return HashUtil.combineHashes(HashUtil.hash(_castedSrcData.getClassifierName()),HashUtil.hash(_castedSrcData.getName()));
}
public int computeOffHeapHashCodeFromRelated(Object _srcObject, Object _srcData)
{
EnumerationPropertyData _castedSrcData = (EnumerationPropertyData) _srcData;
return HashUtil.combineHashes(HashUtil.offHeapHash(_castedSrcData.getClassifierName()),HashUtil.offHeapHash(_castedSrcData.getName()));
}
}
public EnumerationPropertyAbstract()
{
this.persistenceState = MEMORY_STATE;
}
public EnumerationProperty getDetachedCopy() throws MithraBusinessException
{
return (EnumerationProperty) super.getDetachedCopy();
}
public EnumerationProperty getNonPersistentCopy() throws MithraBusinessException
{
EnumerationProperty result = (EnumerationProperty) super.getNonPersistentCopy();
result.persistenceState = MEMORY_STATE;
return result;
}
public EnumerationProperty copyDetachedValuesToOriginalOrInsertIfNew()
{
return (EnumerationProperty) this.zCopyDetachedValuesToOriginalOrInsertIfNew();
}
public EnumerationProperty zFindOriginal()
{
EnumerationPropertyData data = (EnumerationPropertyData) this.currentData;
Operation op;
op = EnumerationPropertyFinder.classifierName().eq(data.getClassifierName());
op = op.and(EnumerationPropertyFinder.name().eq(data.getName()));
return EnumerationPropertyFinder.findOne(op);
}
public boolean isModifiedSinceDetachmentByDependentRelationships()
{
if(this.isModifiedSinceDetachment()) return true;
return false;
}
private Logger getLogger()
{
return logger;
}
public MithraDataObject zAllocateData()
{
return new EnumerationPropertyData();
}
protected void zSetFromEnumerationPropertyData( EnumerationPropertyData data )
{
super.zSetData(data);
this.persistenceState = PERSISTED_STATE;
}
public void setFromEnumerationPropertyData( EnumerationPropertyData data )
{
super.zSetData(data);
}
public void zWriteDataClassName(ObjectOutput out) throws IOException
{
}
public final boolean isClassifierNameNull()
{
return ((EnumerationPropertyData) this.zSynchronizedGetData()).isClassifierNameNull();
}
public final String getClassifierName()
{
EnumerationPropertyData data = (EnumerationPropertyData) 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(EnumerationPropertyFinder.classifierName(), newValue, true, false );
}
public boolean isEnumerationNameNull()
{
return ((EnumerationPropertyData) this.zSynchronizedGetData()).isEnumerationNameNull();
}
public String getEnumerationName()
{
EnumerationPropertyData data = (EnumerationPropertyData) this.zSynchronizedGetData();
return data.getEnumerationName();
}
public void setEnumerationName(String newValue)
{
if (newValue != null && newValue.length() > 256)
throw new MithraBusinessException("Attribute 'enumerationName' cannot exceed maximum length of 256: " + newValue);
zSetString(EnumerationPropertyFinder.enumerationName(), newValue, false, false );
}
public final boolean isNameNull()
{
return ((EnumerationPropertyData) this.zSynchronizedGetData()).isNameNull();
}
public final String getName()
{
EnumerationPropertyData data = (EnumerationPropertyData) this.zSynchronizedGetData();
return data.getName();
}
public void setName(String newValue)
{
if (newValue != null && newValue.length() > 256)
throw new MithraBusinessException("Attribute 'name' cannot exceed maximum length of 256: " + newValue);
zSetString(EnumerationPropertyFinder.name(), newValue, true, false );
}
protected void issuePrimitiveNullSetters(TransactionalBehavior behavior, MithraDataObject data)
{
}
public void zPersistDetachedRelationships(MithraDataObject _data)
{
EnumerationPropertyData _newData = (EnumerationPropertyData) _data;
}
public void zSetTxDetachedDeleted()
{
TransactionalBehavior _behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary();
if (_behavior.isDetached() && _behavior.isDeleted()) return;
EnumerationPropertyData _newData = (EnumerationPropertyData) _behavior.getCurrentDataForRead(this);
this.zSetTxPersistenceState(PersistenceState.DETACHED_DELETED);
}
public void zSetNonTxDetachedDeleted()
{
TransactionalBehavior _behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary();
EnumerationPropertyData _newData = (EnumerationPropertyData) _behavior.getCurrentDataForRead(this);
this.zSetNonTxPersistenceState(PersistenceState.DETACHED_DELETED);
}
/**
* Relationship Expression:
this.enumerationName = Enumeration.name
* @see Enumeration#getEnumerationProperties() reverse relationship Enumeration.getEnumerationProperties()
* @return The enumeration
*/
public Enumeration getEnumeration()
{
Enumeration _result = null;
Operation _op = null;
TransactionalBehavior _behavior = zGetTransactionalBehaviorForReadWithWaitIfNecessary();
EnumerationPropertyData _data = (EnumerationPropertyData) _behavior.getCurrentDataForRead(this);
MithraObjectPortal _portal = null;
if (_behavior.isPersisted())
{
{
_portal = EnumerationFinder.getMithraObjectPortal();
Object _related = _portal.getAsOneFromCache(this, _data, forenumeration, null, null);
if (!(_related instanceof NulledRelation)) _result = (Enumeration) _related;
if (_related == null)
{
_op = EnumerationFinder.name().eq(_data.getEnumerationName());
}
}
}
else if (_behavior.isDetached())
{
{
{
Operation detachedOp = EnumerationFinder.name().eq(_data.getEnumerationName());
_result = EnumerationFinder.zFindOneForRelationship(detachedOp);
}
}
}
else if (_behavior.isInMemory())
{
_result = (Enumeration) _data.getEnumeration();
if (_result == null)
{
{
_op = EnumerationFinder.name().eq(_data.getEnumerationName());
}
}
}
if (_op != null)
{
_result = EnumerationFinder.zFindOneForRelationship(_op);
}
return _result;
}
public void setEnumeration(Enumeration enumeration)
{
Enumeration _enumeration = (Enumeration) enumeration;
TransactionalBehavior _behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary();
EnumerationPropertyData _data = (EnumerationPropertyData) _behavior.getCurrentDataForWrite(this);
if (_behavior.isInMemory())
{
_data.setEnumeration(_enumeration);
if (_enumeration == null)
{
this.setEnumerationName(null);
}
else
{
this.setEnumerationName(_enumeration.getName());
}
}
else if (_behavior.isPersisted())
{
_behavior.clearTempTransaction(this);
if (_enumeration == null)
{
this.setEnumerationName(null);
}
else
{
this.setEnumerationName(
_enumeration.getName());
}
}
else throw new RuntimeException("not implemented");
}
/**
* Relationship Expression:
(DataTypeProperty.classifierName = this.classifierName and DataTypeProperty.name = this.name )
* @see DataTypeProperty#getEnumerationPropertySubClass() reverse relationship DataTypeProperty.getEnumerationPropertySubClass()
* @return The data type property super class
*/
public DataTypeProperty getDataTypePropertySuperClass()
{
DataTypeProperty _result = null;
Operation _op = null;
TransactionalBehavior _behavior = zGetTransactionalBehaviorForReadWithWaitIfNecessary();
EnumerationPropertyData _data = (EnumerationPropertyData) _behavior.getCurrentDataForRead(this);
MithraObjectPortal _portal = null;
if (_behavior.isPersisted())
{
{
_portal = DataTypePropertyFinder.getMithraObjectPortal();
Object _related = _portal.getAsOneFromCache(this, _data, fordataTypePropertySuperClass, null, null);
if (!(_related instanceof NulledRelation)) _result = (DataTypeProperty) _related;
if (_related == null)
{
_op = new RelationshipMultiEqualityOperation(EnumerationPropertyFinder.dataTypePropertySuperClass().zGetRelationshipMultiExtractor(), this);
}
}
}
else if (_behavior.isDetached())
{
if (_data.getDataTypePropertySuperClass() instanceof NulledRelation)
{
return null;
}
_result = (DataTypeProperty) _data.getDataTypePropertySuperClass();
if (_result == null)
{
{
Operation detachedOp = new RelationshipMultiEqualityOperation(EnumerationPropertyFinder.dataTypePropertySuperClass().zGetRelationshipMultiExtractor(), this);
_result = DataTypePropertyFinder.zFindOneForRelationship(detachedOp);
if(_result != null)
{
_result = _result.getDetachedCopy();
}
}
_data = (EnumerationPropertyData) _behavior.getCurrentDataForWrite(this);
_data.setDataTypePropertySuperClass(_result);
}
}
else if (_behavior.isInMemory())
{
_result = (DataTypeProperty) _data.getDataTypePropertySuperClass();
if (_result == null)
{
{
_op = new RelationshipMultiEqualityOperation(EnumerationPropertyFinder.dataTypePropertySuperClass().zGetRelationshipMultiExtractor(), this);
}
}
}
if (_op != null)
{
_result = DataTypePropertyFinder.zFindOneForRelationship(_op);
}
return _result;
}
public void setDataTypePropertySuperClass(DataTypeProperty dataTypePropertySuperClass)
{
((DataTypeProperty)dataTypePropertySuperClass).setEnumerationPropertySubClass((EnumerationProperty)this);
}
public void zSetParentContainerdataTypePropertySuperClass(DataTypePropertyAbstract parent)
{
TransactionalBehavior _behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary();
EnumerationPropertyData _data = (EnumerationPropertyData) _behavior.getCurrentDataForWrite(this);
_behavior.clearTempTransaction(this);
if (_behavior.isInMemory())
{
_data.setDataTypePropertySuperClass(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 EnumerationProperty zCascadeCopyThenInsert() throws MithraBusinessException
{
TransactionalBehavior _behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary();
EnumerationProperty original = (EnumerationProperty) _behavior.copyThenInsert(this);
return original;
}
protected void cascadeDeleteImpl() throws MithraBusinessException
{
this.delete();
}
public Cache zGetCache()
{
return EnumerationPropertyFinder.getMithraObjectPortal().getCache();
}
public MithraObjectPortal zGetPortal()
{
return EnumerationPropertyFinder.getMithraObjectPortal();
}
public EnumerationProperty getOriginalPersistentObject()
{
return this.zFindOriginal();
}
protected boolean issueUpdatesForNonPrimaryKeys(TransactionalBehavior behavior, MithraDataObject data, MithraDataObject newData)
{
boolean changed = false;
changed |= zUpdateString(behavior, data, newData, EnumerationPropertyFinder.enumerationName(), false);
return changed;
}
protected boolean issueUpdatesForPrimaryKeys(TransactionalBehavior behavior, MithraDataObject data, MithraDataObject newData)
{
boolean changed = false;
changed |= zUpdateString(behavior, data, newData, EnumerationPropertyFinder.classifierName(), false);
changed |= zUpdateString(behavior, data, newData, EnumerationPropertyFinder.name(), false);
return changed;
}
public Object readResolve() throws ObjectStreamException
{
EnumerationPropertyAbstract result = (EnumerationPropertyAbstract) 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