klass.model.meta.domain.PropertyModifierAbstract 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 PropertyModifierAbstract extends com.gs.fw.common.mithra.superclassimpl.MithraTransactionalObjectImpl
implements
Element
{
private static byte MEMORY_STATE = PersistenceState.IN_MEMORY;
private static byte PERSISTED_STATE = PersistenceState.PERSISTED;
private static final Logger logger = LoggerFactory.getLogger(PropertyModifier.class.getName());
private static final RelationshipHashStrategy fordataTypeProperty = new DataTypePropertyRhs();
private static final class DataTypePropertyRhs implements RelationshipHashStrategy
{
public boolean equalsForRelationship(Object _srcObject, Object _srcData, Object _targetData, Timestamp _asOfDate0, Timestamp _asOfDate1)
{
PropertyModifierData _castedSrcData = (PropertyModifierData) _srcData;
DataTypePropertyData _castedTargetData = (DataTypePropertyData) _targetData;
if (_castedSrcData.getClassifierName()!= null && _castedSrcData.getClassifierName().equals(_castedTargetData.getClassifierName()) && _castedSrcData.getPropertyName()!= null && _castedSrcData.getPropertyName().equals(_castedTargetData.getName()))
{
return true;
}
return false;
}
public int computeHashCodeFromRelated(Object _srcObject, Object _srcData)
{
PropertyModifierData _castedSrcData = (PropertyModifierData) _srcData;
return HashUtil.combineHashes(HashUtil.hash(_castedSrcData.getClassifierName()),HashUtil.hash(_castedSrcData.getPropertyName()));
}
public int computeOffHeapHashCodeFromRelated(Object _srcObject, Object _srcData)
{
PropertyModifierData _castedSrcData = (PropertyModifierData) _srcData;
return HashUtil.combineHashes(HashUtil.offHeapHash(_castedSrcData.getClassifierName()),HashUtil.offHeapHash(_castedSrcData.getPropertyName()));
}
}
public PropertyModifierAbstract()
{
this.persistenceState = MEMORY_STATE;
}
public PropertyModifier getDetachedCopy() throws MithraBusinessException
{
return (PropertyModifier) super.getDetachedCopy();
}
public PropertyModifier getNonPersistentCopy() throws MithraBusinessException
{
PropertyModifier result = (PropertyModifier) super.getNonPersistentCopy();
result.persistenceState = MEMORY_STATE;
return result;
}
public PropertyModifier copyDetachedValuesToOriginalOrInsertIfNew()
{
return (PropertyModifier) this.zCopyDetachedValuesToOriginalOrInsertIfNew();
}
public PropertyModifier zFindOriginal()
{
PropertyModifierData data = (PropertyModifierData) this.currentData;
Operation op;
op = PropertyModifierFinder.classifierName().eq(data.getClassifierName());
op = op.and(PropertyModifierFinder.propertyName().eq(data.getPropertyName()));
op = op.and(PropertyModifierFinder.keyword().eq(data.getKeyword()));
return PropertyModifierFinder.findOne(op);
}
public boolean isModifiedSinceDetachmentByDependentRelationships()
{
if(this.isModifiedSinceDetachment()) return true;
return false;
}
private Logger getLogger()
{
return logger;
}
public MithraDataObject zAllocateData()
{
return new PropertyModifierData();
}
protected void zSetFromPropertyModifierData( PropertyModifierData data )
{
super.zSetData(data);
this.persistenceState = PERSISTED_STATE;
}
public void setFromPropertyModifierData( PropertyModifierData data )
{
super.zSetData(data);
}
public void zWriteDataClassName(ObjectOutput out) throws IOException
{
}
public final boolean isClassifierNameNull()
{
return ((PropertyModifierData) this.zSynchronizedGetData()).isClassifierNameNull();
}
public final String getClassifierName()
{
PropertyModifierData data = (PropertyModifierData) 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(PropertyModifierFinder.classifierName(), newValue, true, false );
}
public final boolean isKeywordNull()
{
return ((PropertyModifierData) this.zSynchronizedGetData()).isKeywordNull();
}
public final String getKeyword()
{
PropertyModifierData data = (PropertyModifierData) this.zSynchronizedGetData();
return data.getKeyword();
}
public void setKeyword(String newValue)
{
if (newValue != null && newValue.length() > 256)
throw new MithraBusinessException("Attribute 'keyword' cannot exceed maximum length of 256: " + newValue);
zSetString(PropertyModifierFinder.keyword(), newValue, true, false );
}
public boolean isOrdinalNull()
{
return ((PropertyModifierData) this.zSynchronizedGetData()).isOrdinalNull();
}
public int getOrdinal()
{
PropertyModifierData data = (PropertyModifierData) this.zSynchronizedGetData();
return data.getOrdinal();
}
public void setOrdinal(int newValue)
{
zSetInteger(PropertyModifierFinder.ordinal(), newValue, false, false ,false);
}
public final boolean isPropertyNameNull()
{
return ((PropertyModifierData) this.zSynchronizedGetData()).isPropertyNameNull();
}
public final String getPropertyName()
{
PropertyModifierData data = (PropertyModifierData) this.zSynchronizedGetData();
return data.getPropertyName();
}
public void setPropertyName(String newValue)
{
if (newValue != null && newValue.length() > 256)
throw new MithraBusinessException("Attribute 'propertyName' cannot exceed maximum length of 256: " + newValue);
zSetString(PropertyModifierFinder.propertyName(), newValue, true, false );
}
protected void issuePrimitiveNullSetters(TransactionalBehavior behavior, MithraDataObject data)
{
}
public void zPersistDetachedRelationships(MithraDataObject _data)
{
PropertyModifierData _newData = (PropertyModifierData) _data;
}
public void zSetTxDetachedDeleted()
{
TransactionalBehavior _behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary();
if (_behavior.isDetached() && _behavior.isDeleted()) return;
PropertyModifierData _newData = (PropertyModifierData) _behavior.getCurrentDataForRead(this);
this.zSetTxPersistenceState(PersistenceState.DETACHED_DELETED);
}
public void zSetNonTxDetachedDeleted()
{
TransactionalBehavior _behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary();
PropertyModifierData _newData = (PropertyModifierData) _behavior.getCurrentDataForRead(this);
this.zSetNonTxPersistenceState(PersistenceState.DETACHED_DELETED);
}
/**
* Relationship Expression:
(DataTypeProperty.classifierName = this.classifierName and DataTypeProperty.name = this.propertyName )
* @see DataTypeProperty#getPropertyModifiers() reverse relationship DataTypeProperty.getPropertyModifiers()
* @return The data type property
*/
public DataTypeProperty getDataTypeProperty()
{
DataTypeProperty _result = null;
Operation _op = null;
TransactionalBehavior _behavior = zGetTransactionalBehaviorForReadWithWaitIfNecessary();
PropertyModifierData _data = (PropertyModifierData) _behavior.getCurrentDataForRead(this);
MithraObjectPortal _portal = null;
if (_behavior.isPersisted())
{
{
_portal = DataTypePropertyFinder.getMithraObjectPortal();
Object _related = _portal.getAsOneFromCache(this, _data, fordataTypeProperty, null, null);
if (!(_related instanceof NulledRelation)) _result = (DataTypeProperty) _related;
if (_related == null)
{
_op = new RelationshipMultiEqualityOperation(PropertyModifierFinder.dataTypeProperty().zGetRelationshipMultiExtractor(), this);
}
}
}
else if (_behavior.isDetached())
{
{
{
Operation detachedOp = new RelationshipMultiEqualityOperation(PropertyModifierFinder.dataTypeProperty().zGetRelationshipMultiExtractor(), this);
_result = DataTypePropertyFinder.zFindOneForRelationship(detachedOp);
}
}
}
else if (_behavior.isInMemory())
{
_result = (DataTypeProperty) _data.getDataTypeProperty();
if (_result == null)
{
{
_op = new RelationshipMultiEqualityOperation(PropertyModifierFinder.dataTypeProperty().zGetRelationshipMultiExtractor(), this);
}
}
}
if (_op != null)
{
_result = DataTypePropertyFinder.zFindOneForRelationship(_op);
}
return _result;
}
public void setDataTypeProperty(DataTypeProperty dataTypeProperty)
{
DataTypeProperty _dataTypeProperty = (DataTypeProperty) dataTypeProperty;
TransactionalBehavior _behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary();
PropertyModifierData _data = (PropertyModifierData) _behavior.getCurrentDataForWrite(this);
if (_behavior.isInMemory())
{
_data.setDataTypeProperty(_dataTypeProperty);
if (_dataTypeProperty == null)
{
this.setClassifierName(null);
this.setPropertyName(null);
}
else
{
this.setClassifierName(_dataTypeProperty.getClassifierName());
this.setPropertyName(_dataTypeProperty.getName());
}
}
else if (_behavior.isPersisted())
{
_behavior.clearTempTransaction(this);
if (_dataTypeProperty == null)
{
this.setClassifierName(null);
this.setPropertyName(null);
}
else
{
this.setClassifierName(
_dataTypeProperty.getClassifierName());
this.setPropertyName(
_dataTypeProperty.getName());
}
}
else throw new RuntimeException("not implemented");
}
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 PropertyModifier zCascadeCopyThenInsert() throws MithraBusinessException
{
TransactionalBehavior _behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary();
PropertyModifier original = (PropertyModifier) _behavior.copyThenInsert(this);
return original;
}
protected void cascadeDeleteImpl() throws MithraBusinessException
{
this.delete();
}
public Cache zGetCache()
{
return PropertyModifierFinder.getMithraObjectPortal().getCache();
}
public MithraObjectPortal zGetPortal()
{
return PropertyModifierFinder.getMithraObjectPortal();
}
public PropertyModifier getOriginalPersistentObject()
{
return this.zFindOriginal();
}
protected boolean issueUpdatesForNonPrimaryKeys(TransactionalBehavior behavior, MithraDataObject data, MithraDataObject newData)
{
boolean changed = false;
changed |= zUpdateInteger(behavior, data, newData, PropertyModifierFinder.ordinal(), false);
return changed;
}
protected boolean issueUpdatesForPrimaryKeys(TransactionalBehavior behavior, MithraDataObject data, MithraDataObject newData)
{
boolean changed = false;
changed |= zUpdateString(behavior, data, newData, PropertyModifierFinder.classifierName(), false);
changed |= zUpdateString(behavior, data, newData, PropertyModifierFinder.keyword(), false);
changed |= zUpdateString(behavior, data, newData, PropertyModifierFinder.propertyName(), false);
return changed;
}
public Object readResolve() throws ObjectStreamException
{
PropertyModifierAbstract result = (PropertyModifierAbstract) 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