klass.model.meta.domain.ParameterizedPropertyAbstract 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 ParameterizedPropertyAbstract extends com.gs.fw.common.mithra.superclassimpl.MithraTransactionalObjectImpl
implements
NamedElement
{
private static byte MEMORY_STATE = PersistenceState.IN_MEMORY;
private static byte PERSISTED_STATE = PersistenceState.PERSISTED;
private static final Logger logger = LoggerFactory.getLogger(ParameterizedProperty.class.getName());
private static final RelationshipHashStrategy forresultType = new ResultTypeRhs();
private static final RelationshipHashStrategy forowningClass = new OwningClassRhs();
private static final class ResultTypeRhs implements RelationshipHashStrategy
{
public boolean equalsForRelationship(Object _srcObject, Object _srcData, Object _targetData, Timestamp _asOfDate0, Timestamp _asOfDate1)
{
ParameterizedPropertyData _castedSrcData = (ParameterizedPropertyData) _srcData;
KlassData _castedTargetData = (KlassData) _targetData;
if (_castedSrcData.getResultTypeName()!= null && _castedSrcData.getResultTypeName().equals(_castedTargetData.getName()))
{
return true;
}
return false;
}
public int computeHashCodeFromRelated(Object _srcObject, Object _srcData)
{
ParameterizedPropertyData _castedSrcData = (ParameterizedPropertyData) _srcData;
return HashUtil.hash(_castedSrcData.getResultTypeName());
}
public int computeOffHeapHashCodeFromRelated(Object _srcObject, Object _srcData)
{
ParameterizedPropertyData _castedSrcData = (ParameterizedPropertyData) _srcData;
return HashUtil.offHeapHash(_castedSrcData.getResultTypeName());
}
}
private static final class OwningClassRhs implements RelationshipHashStrategy
{
public boolean equalsForRelationship(Object _srcObject, Object _srcData, Object _targetData, Timestamp _asOfDate0, Timestamp _asOfDate1)
{
ParameterizedPropertyData _castedSrcData = (ParameterizedPropertyData) _srcData;
KlassData _castedTargetData = (KlassData) _targetData;
if (_castedSrcData.getOwningClassName()!= null && _castedSrcData.getOwningClassName().equals(_castedTargetData.getName()))
{
return true;
}
return false;
}
public int computeHashCodeFromRelated(Object _srcObject, Object _srcData)
{
ParameterizedPropertyData _castedSrcData = (ParameterizedPropertyData) _srcData;
return HashUtil.hash(_castedSrcData.getOwningClassName());
}
public int computeOffHeapHashCodeFromRelated(Object _srcObject, Object _srcData)
{
ParameterizedPropertyData _castedSrcData = (ParameterizedPropertyData) _srcData;
return HashUtil.offHeapHash(_castedSrcData.getOwningClassName());
}
}
public ParameterizedPropertyAbstract()
{
this.persistenceState = MEMORY_STATE;
}
public ParameterizedProperty getDetachedCopy() throws MithraBusinessException
{
return (ParameterizedProperty) super.getDetachedCopy();
}
public ParameterizedProperty getNonPersistentCopy() throws MithraBusinessException
{
ParameterizedProperty result = (ParameterizedProperty) super.getNonPersistentCopy();
result.persistenceState = MEMORY_STATE;
return result;
}
public ParameterizedProperty copyDetachedValuesToOriginalOrInsertIfNew()
{
return (ParameterizedProperty) this.zCopyDetachedValuesToOriginalOrInsertIfNew();
}
public ParameterizedProperty zFindOriginal()
{
ParameterizedPropertyData data = (ParameterizedPropertyData) this.currentData;
Operation op;
op = ParameterizedPropertyFinder.owningClassName().eq(data.getOwningClassName());
op = op.and(ParameterizedPropertyFinder.name().eq(data.getName()));
return ParameterizedPropertyFinder.findOne(op);
}
public boolean isModifiedSinceDetachmentByDependentRelationships()
{
if(this.isModifiedSinceDetachment()) return true;
if(isParameterizedPropertyOrderingsModifiedSinceDetachment()) return true;
return false;
}
private Logger getLogger()
{
return logger;
}
public MithraDataObject zAllocateData()
{
return new ParameterizedPropertyData();
}
protected void zSetFromParameterizedPropertyData( ParameterizedPropertyData data )
{
super.zSetData(data);
this.persistenceState = PERSISTED_STATE;
}
public void setFromParameterizedPropertyData( ParameterizedPropertyData data )
{
super.zSetData(data);
}
public void zWriteDataClassName(ObjectOutput out) throws IOException
{
}
public boolean isMultiplicityNull()
{
return ((ParameterizedPropertyData) this.zSynchronizedGetData()).isMultiplicityNull();
}
public String getMultiplicity()
{
ParameterizedPropertyData data = (ParameterizedPropertyData) this.zSynchronizedGetData();
return data.getMultiplicity();
}
public void setMultiplicity(String newValue)
{
if (newValue != null && newValue.length() > 256)
throw new MithraBusinessException("Attribute 'multiplicity' cannot exceed maximum length of 256: " + newValue);
zSetString(ParameterizedPropertyFinder.multiplicity(), newValue, false, false );
}
public final boolean isNameNull()
{
return ((ParameterizedPropertyData) this.zSynchronizedGetData()).isNameNull();
}
public final String getName()
{
ParameterizedPropertyData data = (ParameterizedPropertyData) 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);
MithraDataObject d = zSetString(ParameterizedPropertyFinder.name(), newValue, true, false );
if (d == null) return;
ParameterizedPropertyData data = (ParameterizedPropertyData) d;
TransactionalBehavior _behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary();
if (!_behavior.isPersisted())
{
ParameterizedPropertyOrderingList parameterizedPropertyOrderings =
(ParameterizedPropertyOrderingList ) data.getParameterizedPropertyOrderings();
if (parameterizedPropertyOrderings != null)
{
parameterizedPropertyOrderings.setName(newValue);
}
}
}
public boolean isOrdinalNull()
{
return ((ParameterizedPropertyData) this.zSynchronizedGetData()).isOrdinalNull();
}
public int getOrdinal()
{
ParameterizedPropertyData data = (ParameterizedPropertyData) this.zSynchronizedGetData();
return data.getOrdinal();
}
public void setOrdinal(int newValue)
{
zSetInteger(ParameterizedPropertyFinder.ordinal(), newValue, false, false ,false);
}
public final boolean isOwningClassNameNull()
{
return ((ParameterizedPropertyData) this.zSynchronizedGetData()).isOwningClassNameNull();
}
public final String getOwningClassName()
{
ParameterizedPropertyData data = (ParameterizedPropertyData) this.zSynchronizedGetData();
return data.getOwningClassName();
}
public void setOwningClassName(String newValue)
{
if (newValue != null && newValue.length() > 256)
throw new MithraBusinessException("Attribute 'owningClassName' cannot exceed maximum length of 256: " + newValue);
MithraDataObject d = zSetString(ParameterizedPropertyFinder.owningClassName(), newValue, true, false );
if (d == null) return;
ParameterizedPropertyData data = (ParameterizedPropertyData) d;
TransactionalBehavior _behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary();
if (!_behavior.isPersisted())
{
ParameterizedPropertyOrderingList parameterizedPropertyOrderings =
(ParameterizedPropertyOrderingList ) data.getParameterizedPropertyOrderings();
if (parameterizedPropertyOrderings != null)
{
parameterizedPropertyOrderings.setOwningClassName(newValue);
}
}
}
public boolean isResultTypeNameNull()
{
return ((ParameterizedPropertyData) this.zSynchronizedGetData()).isResultTypeNameNull();
}
public String getResultTypeName()
{
ParameterizedPropertyData data = (ParameterizedPropertyData) this.zSynchronizedGetData();
return data.getResultTypeName();
}
public void setResultTypeName(String newValue)
{
if (newValue != null && newValue.length() > 256)
throw new MithraBusinessException("Attribute 'resultTypeName' cannot exceed maximum length of 256: " + newValue);
zSetString(ParameterizedPropertyFinder.resultTypeName(), newValue, false, false );
}
protected void issuePrimitiveNullSetters(TransactionalBehavior behavior, MithraDataObject data)
{
}
public void zPersistDetachedRelationships(MithraDataObject _data)
{
ParameterizedPropertyData _newData = (ParameterizedPropertyData) _data;
{
ParameterizedPropertyOrderingList parameterizedPropertyOrderings =
(ParameterizedPropertyOrderingList) _newData.getParameterizedPropertyOrderings();
if (parameterizedPropertyOrderings != null)
{
parameterizedPropertyOrderings.copyDetachedValuesToOriginalOrInsertIfNewOrDeleteIfRemoved();
}
}
}
public void zSetTxDetachedDeleted()
{
TransactionalBehavior _behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary();
if (_behavior.isDetached() && _behavior.isDeleted()) return;
ParameterizedPropertyData _newData = (ParameterizedPropertyData) _behavior.getCurrentDataForRead(this);
if (_newData.getParameterizedPropertyOrderings() != null && !(_newData.getParameterizedPropertyOrderings() instanceof NulledRelation))
{
((ParameterizedPropertyOrderingList)_newData.getParameterizedPropertyOrderings()).zSetTxDetachedDeleted();
}
this.zSetTxPersistenceState(PersistenceState.DETACHED_DELETED);
}
public void zSetNonTxDetachedDeleted()
{
TransactionalBehavior _behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary();
ParameterizedPropertyData _newData = (ParameterizedPropertyData) _behavior.getCurrentDataForRead(this);
if (_newData.getParameterizedPropertyOrderings() != null && !(_newData.getParameterizedPropertyOrderings() instanceof NulledRelation))
{
((ParameterizedPropertyOrderingList)_newData.getParameterizedPropertyOrderings()).zSetNonTxDetachedDeleted();
}
this.zSetNonTxPersistenceState(PersistenceState.DETACHED_DELETED);
}
/**
* Relationship Expression:
this.resultTypeName = Klass.name
* @see Klass#getParameterizedPropertiesResultTypeOf() reverse relationship Klass.getParameterizedPropertiesResultTypeOf()
* @return The result type
*/
public Klass getResultType()
{
Klass _result = null;
Operation _op = null;
TransactionalBehavior _behavior = zGetTransactionalBehaviorForReadWithWaitIfNecessary();
ParameterizedPropertyData _data = (ParameterizedPropertyData) _behavior.getCurrentDataForRead(this);
MithraObjectPortal _portal = null;
if (_behavior.isPersisted())
{
{
_portal = KlassFinder.getMithraObjectPortal();
Object _related = _portal.getAsOneFromCache(this, _data, forresultType, null, null);
if (!(_related instanceof NulledRelation)) _result = (Klass) _related;
if (_related == null)
{
_op = KlassFinder.name().eq(_data.getResultTypeName());
}
}
}
else if (_behavior.isDetached())
{
{
{
Operation detachedOp = KlassFinder.name().eq(_data.getResultTypeName());
_result = KlassFinder.zFindOneForRelationship(detachedOp);
}
}
}
else if (_behavior.isInMemory())
{
_result = (Klass) _data.getResultType();
if (_result == null)
{
{
_op = KlassFinder.name().eq(_data.getResultTypeName());
}
}
}
if (_op != null)
{
_result = KlassFinder.zFindOneForRelationship(_op);
}
return _result;
}
public void setResultType(Klass resultType)
{
Klass _resultType = (Klass) resultType;
TransactionalBehavior _behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary();
ParameterizedPropertyData _data = (ParameterizedPropertyData) _behavior.getCurrentDataForWrite(this);
if (_behavior.isInMemory())
{
_data.setResultType(_resultType);
if (_resultType == null)
{
this.setResultTypeName(null);
}
else
{
this.setResultTypeName(_resultType.getName());
}
}
else if (_behavior.isPersisted())
{
_behavior.clearTempTransaction(this);
if (_resultType == null)
{
this.setResultTypeName(null);
}
else
{
this.setResultTypeName(
_resultType.getName());
}
}
else throw new RuntimeException("not implemented");
}
/**
* Relationship Expression:
this.owningClassName = ParameterizedPropertyOrdering.owningClassName and this.name = ParameterizedPropertyOrdering.name
* Order By: ordinal asc
.
* @see ParameterizedPropertyOrdering#getParameterizedProperty() reverse relationship ParameterizedPropertyOrdering.getParameterizedProperty()
* @return parameterized property orderings
*/
public ParameterizedPropertyOrderingList getParameterizedPropertyOrderings()
{
ParameterizedPropertyOrderingList _result = null;
Operation _op = null;
TransactionalBehavior _behavior = zGetTransactionalBehaviorForReadWithWaitIfNecessary();
ParameterizedPropertyData _data = (ParameterizedPropertyData) _behavior.getCurrentDataForRead(this);
if (_behavior.isPersisted())
{
{
{
_op = new RelationshipMultiEqualityOperation(ParameterizedPropertyFinder.parameterizedPropertyOrderings().zGetRelationshipMultiExtractor(), this);
}
}
}
else if (_behavior.isDetached())
{
_result = (ParameterizedPropertyOrderingList) _data.getParameterizedPropertyOrderings();
if (_result == null)
{
{
Operation detachedOp = new RelationshipMultiEqualityOperation(ParameterizedPropertyFinder.parameterizedPropertyOrderings().zGetRelationshipMultiExtractor(), this);
_result = new ParameterizedPropertyOrderingList(detachedOp);
_result.zSetForRelationship();
if(_result != null)
{
_result = _result.getDetachedCopy();
}
_result.zSetAddHandler(new ParameterizedPropertyOrderingsAddHandlerInMemory());
}
_result.setOrderBy(ParameterizedPropertyOrderingFinder.ordinal().ascendingOrderBy());
_behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary();
_data = (ParameterizedPropertyData) _behavior.getCurrentDataForWrite(this);
_data.setParameterizedPropertyOrderings(_result);
if (_result != null) _result.zSetParentContainerparameterizedProperty(this);
}
}
else if (_behavior.isInMemory())
{
_result = (ParameterizedPropertyOrderingList) _data.getParameterizedPropertyOrderings();
if (_result == null)
{
_result = new ParameterizedPropertyOrderingList();
_result.zSetAddHandler(new ParameterizedPropertyOrderingsAddHandlerInMemory());
_behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary();
_data = (ParameterizedPropertyData) _behavior.getCurrentDataForWrite(this);
_data.setParameterizedPropertyOrderings(_result);
}
}
if (_op != null)
{
_result = new ParameterizedPropertyOrderingList(_op);
_result.zSetForRelationship();
_result.zSetRemoveHandler(DeleteOnRemoveHandler.getInstance());
_result.zSetAddHandler(new ParameterizedPropertyOrderingsAddHandlerPersisted());
_result.setOrderBy(ParameterizedPropertyOrderingFinder.ordinal().ascendingOrderBy());
}
return _result;
}
public void setParameterizedPropertyOrderings(ParameterizedPropertyOrderingList parameterizedPropertyOrderings)
{
ParameterizedPropertyOrderingList _parameterizedPropertyOrderings = (ParameterizedPropertyOrderingList) parameterizedPropertyOrderings;
TransactionalBehavior _behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary();
ParameterizedPropertyData _data = (ParameterizedPropertyData) _behavior.getCurrentDataForWrite(this);
if (_behavior.isInMemory())
{
if (_behavior.isDetached() && _parameterizedPropertyOrderings != null)
{
_parameterizedPropertyOrderings.zMakeDetached(new RelationshipMultiEqualityOperation(ParameterizedPropertyFinder.parameterizedPropertyOrderings().zGetRelationshipMultiExtractor(), this),
_data.getParameterizedPropertyOrderings());
}
_data.setParameterizedPropertyOrderings(_parameterizedPropertyOrderings);
if (_parameterizedPropertyOrderings != null)
{
_parameterizedPropertyOrderings.setOwningClassName(_data.getOwningClassName());
_parameterizedPropertyOrderings.setName(_data.getName());
_parameterizedPropertyOrderings.zSetParentContainerparameterizedProperty(this);
_parameterizedPropertyOrderings.zSetAddHandler(new ParameterizedPropertyOrderingsAddHandlerInMemory());
}
else if (_behavior.isDetached())
{
throw new MithraBusinessException("to-many relationships cannot be set to null. Use the clear() method on the list instead.");
}
}
else if (_behavior.isPersisted())
{
_behavior.clearTempTransaction(this);
_parameterizedPropertyOrderings.zSetAddHandler(new ParameterizedPropertyOrderingsAddHandlerPersisted());
ParameterizedPropertyOrderingList parameterizedPropertyOrderingsToDelete = new ParameterizedPropertyOrderingList();
parameterizedPropertyOrderingsToDelete.addAll(this.getParameterizedPropertyOrderings());
for(int i=0;i < _parameterizedPropertyOrderings.size(); i++)
{
ParameterizedPropertyOrdering item = _parameterizedPropertyOrderings.getParameterizedPropertyOrderingAt(i);
if (!parameterizedPropertyOrderingsToDelete.remove(item))
{
item.setOwningClassName(_data.getOwningClassName());
item.setName(_data.getName());
item.cascadeInsert();
}
}
parameterizedPropertyOrderingsToDelete.cascadeDeleteAll();
}
else throw new RuntimeException("not implemented");
}
public boolean isParameterizedPropertyOrderingsModifiedSinceDetachment()
{
TransactionalBehavior _behavior = zGetTransactionalBehaviorForReadWithWaitIfNecessary();
ParameterizedPropertyData _data = (ParameterizedPropertyData) _behavior.getCurrentDataForRead(this);
ParameterizedPropertyOrderingList parameterizedPropertyOrderings =
(ParameterizedPropertyOrderingList) _data.getParameterizedPropertyOrderings();
if( parameterizedPropertyOrderings != null)
{
return parameterizedPropertyOrderings.isModifiedSinceDetachment();
}
return false;
}
/**
* Relationship Expression:
this.owningClassName = ParameterizedPropertyParameter.classifierName and this.name = ParameterizedPropertyParameter.parameterizedPropertyName
* Order By: ordinal asc
.
* @see ParameterizedPropertyParameter#getParameterizedProperty() reverse relationship ParameterizedPropertyParameter.getParameterizedProperty()
* @return parameters
*/
public ParameterizedPropertyParameterList getParameters()
{
ParameterizedPropertyParameterList _result = null;
Operation _op = null;
TransactionalBehavior _behavior = zGetTransactionalBehaviorForReadWithWaitIfNecessary();
ParameterizedPropertyData _data = (ParameterizedPropertyData) _behavior.getCurrentDataForRead(this);
if (_behavior.isPersisted())
{
{
{
_op = new RelationshipMultiEqualityOperation(ParameterizedPropertyFinder.parameters().zGetRelationshipMultiExtractor(), this);
}
}
}
else if (_behavior.isDetached())
{
{
{
Operation detachedOp = new RelationshipMultiEqualityOperation(ParameterizedPropertyFinder.parameters().zGetRelationshipMultiExtractor(), this);
_result = new ParameterizedPropertyParameterList(detachedOp);
_result.zSetForRelationship();
}
_result.setOrderBy(ParameterizedPropertyParameterFinder.ordinal().ascendingOrderBy());
}
}
else if (_behavior.isInMemory())
{
_result = (ParameterizedPropertyParameterList) _data.getParameters();
if (_result == null)
{
{
_op = new RelationshipMultiEqualityOperation(ParameterizedPropertyFinder.parameters().zGetRelationshipMultiExtractor(), this);
}
}
}
if (_op != null)
{
_result = new ParameterizedPropertyParameterList(_op);
_result.zSetForRelationship();
_result.setOrderBy(ParameterizedPropertyParameterFinder.ordinal().ascendingOrderBy());
}
return _result;
}
public void setParameters(ParameterizedPropertyParameterList parameters)
{
ParameterizedPropertyParameterList _parameters = (ParameterizedPropertyParameterList) parameters;
TransactionalBehavior _behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary();
ParameterizedPropertyData _data = (ParameterizedPropertyData) _behavior.getCurrentDataForWrite(this);
if (_behavior.isInMemory())
{
_data.setParameters(_parameters);
}
else if (_behavior.isPersisted())
{
_behavior.clearTempTransaction(this);
}
else throw new RuntimeException("not implemented");
}
/**
* Relationship Expression:
Klass.name = this.owningClassName
* @see Klass#getParameterizedProperties() reverse relationship Klass.getParameterizedProperties()
* @return The owning class
*/
public Klass getOwningClass()
{
Klass _result = null;
Operation _op = null;
TransactionalBehavior _behavior = zGetTransactionalBehaviorForReadWithWaitIfNecessary();
ParameterizedPropertyData _data = (ParameterizedPropertyData) _behavior.getCurrentDataForRead(this);
MithraObjectPortal _portal = null;
if (_behavior.isPersisted())
{
{
_portal = KlassFinder.getMithraObjectPortal();
Object _related = _portal.getAsOneFromCache(this, _data, forowningClass, null, null);
if (!(_related instanceof NulledRelation)) _result = (Klass) _related;
if (_related == null)
{
_op = KlassFinder.name().eq(_data.getOwningClassName());
}
}
}
else if (_behavior.isDetached())
{
if (_data.getOwningClass() instanceof NulledRelation)
{
return null;
}
_result = (Klass) _data.getOwningClass();
if (_result == null)
{
{
Operation detachedOp = KlassFinder.name().eq(_data.getOwningClassName());
_result = KlassFinder.zFindOneForRelationship(detachedOp);
if(_result != null)
{
_result = _result.getDetachedCopy();
}
}
_data = (ParameterizedPropertyData) _behavior.getCurrentDataForWrite(this);
_data.setOwningClass(_result);
}
}
else if (_behavior.isInMemory())
{
_result = (Klass) _data.getOwningClass();
if (_result == null)
{
{
_op = KlassFinder.name().eq(_data.getOwningClassName());
}
}
}
if (_op != null)
{
_result = KlassFinder.zFindOneForRelationship(_op);
}
return _result;
}
public void setOwningClass(Klass owningClass)
{
Klass _owningClass = (Klass) owningClass;
TransactionalBehavior _behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary();
ParameterizedPropertyData _data = (ParameterizedPropertyData) _behavior.getCurrentDataForWrite(this);
if (_behavior.isInMemory())
{
Object _prev = _data.getOwningClass();
if (_behavior.isDetached() && _prev != null)
{
((DelegatingList)((Klass)_prev).getParameterizedProperties()).zMarkMoved( (ParameterizedProperty) this);
}
_data.setOwningClass(_owningClass);
_owningClass.getParameterizedProperties().add( (ParameterizedProperty) this);
}
else if (_behavior.isPersisted())
{
_behavior.clearTempTransaction(this);
if (_owningClass == null)
{
this.setOwningClassName(null);
}
else
{
this.setOwningClassName(
_owningClass.getName());
}
}
else throw new RuntimeException("not implemented");
}
public void zSetParentContainerowningClass(KlassAbstract parent)
{
TransactionalBehavior _behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary();
ParameterizedPropertyData _data = (ParameterizedPropertyData) _behavior.getCurrentDataForWrite(this);
_behavior.clearTempTransaction(this);
if (_behavior.isInMemory())
{
_data.setOwningClass(parent);
}
}
protected void cascadeInsertImpl() throws MithraBusinessException
{
TransactionalBehavior _behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary();
ParameterizedPropertyData _data = (ParameterizedPropertyData) _behavior.getCurrentDataForWrite(this);
ParameterizedPropertyOrderingList parameterizedPropertyOrderings =
(ParameterizedPropertyOrderingList) _data.getParameterizedPropertyOrderings();
_behavior.insert(this);
if (parameterizedPropertyOrderings != null)
{
parameterizedPropertyOrderings.cascadeInsertAll();
}
}
@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)
{
ParameterizedPropertyFinder.ParameterizedPropertyRelatedFinder parentFinder = (ParameterizedPropertyFinder.ParameterizedPropertyRelatedFinder) parentFinderGeneric;
TransactionalBehavior _behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary();
ParameterizedPropertyData _newData = (ParameterizedPropertyData) _behavior.getCurrentDataForWrite(this);
{
ParameterizedPropertyOrderingList parameterizedPropertyOrderings =
(ParameterizedPropertyOrderingList) _newData.getParameterizedPropertyOrderings();
RelatedFinder dependentFinder = parentFinder.parameterizedPropertyOrderings();
DeepRelationshipUtility.zAddToNavigationStats(dependentFinder, parameterizedPropertyOrderings != null, navigationStats);
if (parameterizedPropertyOrderings != null)
{
parameterizedPropertyOrderings.zCascadeAddNavigatedRelationshipsStats(dependentFinder, navigationStats);
}
}
return navigationStats;
}
@Override
public Map< RelatedFinder, StatisticCounter > zAddNavigatedRelationshipsStatsForDelete(RelatedFinder parentFinder, Map< RelatedFinder, StatisticCounter > navigationStats)
{
DeepRelationshipUtility.zAddAllDependentNavigationsStatsForDelete(parentFinder, navigationStats);
return navigationStats;
}
@Override
public ParameterizedProperty zCascadeCopyThenInsert() throws MithraBusinessException
{
TransactionalBehavior _behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary();
ParameterizedPropertyData _data = (ParameterizedPropertyData) _behavior.getCurrentDataForWrite(this);
ParameterizedPropertyOrderingList parameterizedPropertyOrderings =
(ParameterizedPropertyOrderingList) _data.getParameterizedPropertyOrderings();
ParameterizedProperty original = (ParameterizedProperty) _behavior.copyThenInsert(this);
if (parameterizedPropertyOrderings != null)
{
parameterizedPropertyOrderings.zCascadeCopyThenInsertAll();
}
return original;
}
protected void cascadeDeleteImpl() throws MithraBusinessException
{
this.getParameterizedPropertyOrderings().cascadeDeleteAll();
this.delete();
}
public Cache zGetCache()
{
return ParameterizedPropertyFinder.getMithraObjectPortal().getCache();
}
public MithraObjectPortal zGetPortal()
{
return ParameterizedPropertyFinder.getMithraObjectPortal();
}
public ParameterizedProperty getOriginalPersistentObject()
{
return this.zFindOriginal();
}
protected boolean issueUpdatesForNonPrimaryKeys(TransactionalBehavior behavior, MithraDataObject data, MithraDataObject newData)
{
boolean changed = false;
changed |= zUpdateString(behavior, data, newData, ParameterizedPropertyFinder.multiplicity(), false);
changed |= zUpdateInteger(behavior, data, newData, ParameterizedPropertyFinder.ordinal(), false);
changed |= zUpdateString(behavior, data, newData, ParameterizedPropertyFinder.resultTypeName(), false);
return changed;
}
protected boolean issueUpdatesForPrimaryKeys(TransactionalBehavior behavior, MithraDataObject data, MithraDataObject newData)
{
boolean changed = false;
changed |= zUpdateString(behavior, data, newData, ParameterizedPropertyFinder.name(), false);
changed |= zUpdateString(behavior, data, newData, ParameterizedPropertyFinder.owningClassName(), false);
return changed;
}
public Object readResolve() throws ObjectStreamException
{
ParameterizedPropertyAbstract result = (ParameterizedPropertyAbstract) 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;
}
protected class ParameterizedPropertyOrderingsAddHandlerInMemory implements DependentRelationshipAddHandler
{
public void addRelatedObject(MithraTransactionalObject relatedObject)
{
ParameterizedPropertyOrdering item = (ParameterizedPropertyOrdering) relatedObject;
item.setOwningClassName(getOwningClassName());
item.setName(getName());
item.zSetParentContainerparameterizedProperty(ParameterizedPropertyAbstract.this);
}
}
protected class ParameterizedPropertyOrderingsAddHandlerPersisted implements DependentRelationshipAddHandler
{
public void addRelatedObject(MithraTransactionalObject relatedObject)
{
ParameterizedPropertyOrdering item = (ParameterizedPropertyOrdering) relatedObject;
item.setOwningClassName(getOwningClassName());
item.setName(getName());
item.cascadeInsert();
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy