klass.model.meta.domain.MemberReferencePathAssociationEndMappingAbstract 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 MemberReferencePathAssociationEndMappingAbstract 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(MemberReferencePathAssociationEndMapping.class.getName());
private static final RelationshipHashStrategy forassociationEnd = new AssociationEndRhs();
private static final RelationshipHashStrategy formemberReferencePath = new MemberReferencePathRhs();
private static final class AssociationEndRhs implements RelationshipHashStrategy
{
public boolean equalsForRelationship(Object _srcObject, Object _srcData, Object _targetData, Timestamp _asOfDate0, Timestamp _asOfDate1)
{
MemberReferencePathAssociationEndMappingData _castedSrcData = (MemberReferencePathAssociationEndMappingData) _srcData;
AssociationEndData _castedTargetData = (AssociationEndData) _targetData;
if (_castedSrcData.getAssociationOwningClassName()!= null && _castedSrcData.getAssociationOwningClassName().equals(_castedTargetData.getOwningClassName()) && _castedSrcData.getAssociationEndName()!= null && _castedSrcData.getAssociationEndName().equals(_castedTargetData.getName()))
{
return true;
}
return false;
}
public int computeHashCodeFromRelated(Object _srcObject, Object _srcData)
{
MemberReferencePathAssociationEndMappingData _castedSrcData = (MemberReferencePathAssociationEndMappingData) _srcData;
return HashUtil.combineHashes(HashUtil.hash(_castedSrcData.getAssociationOwningClassName()),HashUtil.hash(_castedSrcData.getAssociationEndName()));
}
public int computeOffHeapHashCodeFromRelated(Object _srcObject, Object _srcData)
{
MemberReferencePathAssociationEndMappingData _castedSrcData = (MemberReferencePathAssociationEndMappingData) _srcData;
return HashUtil.combineHashes(HashUtil.offHeapHash(_castedSrcData.getAssociationOwningClassName()),HashUtil.offHeapHash(_castedSrcData.getAssociationEndName()));
}
}
private static final class MemberReferencePathRhs implements RelationshipHashStrategy
{
public boolean equalsForRelationship(Object _srcObject, Object _srcData, Object _targetData, Timestamp _asOfDate0, Timestamp _asOfDate1)
{
MemberReferencePathAssociationEndMappingData _castedSrcData = (MemberReferencePathAssociationEndMappingData) _srcData;
MemberReferencePathData _castedTargetData = (MemberReferencePathData) _targetData;
if (_castedSrcData.getMemberReferencePathId() == _castedTargetData.getId())
{
return true;
}
return false;
}
public int computeHashCodeFromRelated(Object _srcObject, Object _srcData)
{
MemberReferencePathAssociationEndMappingData _castedSrcData = (MemberReferencePathAssociationEndMappingData) _srcData;
return HashUtil.hash(_castedSrcData.getMemberReferencePathId());
}
public int computeOffHeapHashCodeFromRelated(Object _srcObject, Object _srcData)
{
return computeHashCodeFromRelated(_srcObject, _srcData);
}
}
public MemberReferencePathAssociationEndMappingAbstract()
{
this.persistenceState = MEMORY_STATE;
}
public MemberReferencePathAssociationEndMapping getDetachedCopy() throws MithraBusinessException
{
return (MemberReferencePathAssociationEndMapping) super.getDetachedCopy();
}
public MemberReferencePathAssociationEndMapping getNonPersistentCopy() throws MithraBusinessException
{
MemberReferencePathAssociationEndMapping result = (MemberReferencePathAssociationEndMapping) super.getNonPersistentCopy();
result.persistenceState = MEMORY_STATE;
return result;
}
public MemberReferencePathAssociationEndMapping copyDetachedValuesToOriginalOrInsertIfNew()
{
return (MemberReferencePathAssociationEndMapping) this.zCopyDetachedValuesToOriginalOrInsertIfNew();
}
public MemberReferencePathAssociationEndMapping zFindOriginal()
{
MemberReferencePathAssociationEndMappingData data = (MemberReferencePathAssociationEndMappingData) this.currentData;
Operation op;
op = MemberReferencePathAssociationEndMappingFinder.memberReferencePathId().eq(data.getMemberReferencePathId());
op = op.and(MemberReferencePathAssociationEndMappingFinder.associationOwningClassName().eq(data.getAssociationOwningClassName()));
op = op.and(MemberReferencePathAssociationEndMappingFinder.associationEndName().eq(data.getAssociationEndName()));
return MemberReferencePathAssociationEndMappingFinder.findOne(op);
}
public boolean isModifiedSinceDetachmentByDependentRelationships()
{
if(this.isModifiedSinceDetachment()) return true;
return false;
}
private Logger getLogger()
{
return logger;
}
public MithraDataObject zAllocateData()
{
return new MemberReferencePathAssociationEndMappingData();
}
protected void zSetFromMemberReferencePathAssociationEndMappingData( MemberReferencePathAssociationEndMappingData data )
{
super.zSetData(data);
this.persistenceState = PERSISTED_STATE;
}
public void setFromMemberReferencePathAssociationEndMappingData( MemberReferencePathAssociationEndMappingData data )
{
super.zSetData(data);
}
public void zWriteDataClassName(ObjectOutput out) throws IOException
{
}
public final boolean isAssociationEndNameNull()
{
return ((MemberReferencePathAssociationEndMappingData) this.zSynchronizedGetData()).isAssociationEndNameNull();
}
public final String getAssociationEndName()
{
MemberReferencePathAssociationEndMappingData data = (MemberReferencePathAssociationEndMappingData) this.zSynchronizedGetData();
return data.getAssociationEndName();
}
public void setAssociationEndName(String newValue)
{
if (newValue != null && newValue.length() > 256)
throw new MithraBusinessException("Attribute 'associationEndName' cannot exceed maximum length of 256: " + newValue);
zSetString(MemberReferencePathAssociationEndMappingFinder.associationEndName(), newValue, true, false );
}
public final boolean isAssociationOwningClassNameNull()
{
return ((MemberReferencePathAssociationEndMappingData) this.zSynchronizedGetData()).isAssociationOwningClassNameNull();
}
public final String getAssociationOwningClassName()
{
MemberReferencePathAssociationEndMappingData data = (MemberReferencePathAssociationEndMappingData) this.zSynchronizedGetData();
return data.getAssociationOwningClassName();
}
public void setAssociationOwningClassName(String newValue)
{
if (newValue != null && newValue.length() > 256)
throw new MithraBusinessException("Attribute 'associationOwningClassName' cannot exceed maximum length of 256: " + newValue);
zSetString(MemberReferencePathAssociationEndMappingFinder.associationOwningClassName(), newValue, true, false );
}
public final boolean isMemberReferencePathIdNull()
{
return ((MemberReferencePathAssociationEndMappingData) this.zSynchronizedGetData()).isMemberReferencePathIdNull();
}
public final long getMemberReferencePathId()
{
MemberReferencePathAssociationEndMappingData data = (MemberReferencePathAssociationEndMappingData) this.zSynchronizedGetData();
return data.getMemberReferencePathId();
}
public void setMemberReferencePathId(long newValue)
{
zSetLong(MemberReferencePathAssociationEndMappingFinder.memberReferencePathId(), newValue, true, false ,false);
}
public boolean isOrdinalNull()
{
return ((MemberReferencePathAssociationEndMappingData) this.zSynchronizedGetData()).isOrdinalNull();
}
public int getOrdinal()
{
MemberReferencePathAssociationEndMappingData data = (MemberReferencePathAssociationEndMappingData) this.zSynchronizedGetData();
return data.getOrdinal();
}
public void setOrdinal(int newValue)
{
zSetInteger(MemberReferencePathAssociationEndMappingFinder.ordinal(), newValue, false, false ,false);
}
protected void issuePrimitiveNullSetters(TransactionalBehavior behavior, MithraDataObject data)
{
}
public void zPersistDetachedRelationships(MithraDataObject _data)
{
MemberReferencePathAssociationEndMappingData _newData = (MemberReferencePathAssociationEndMappingData) _data;
}
public void zSetTxDetachedDeleted()
{
TransactionalBehavior _behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary();
if (_behavior.isDetached() && _behavior.isDeleted()) return;
MemberReferencePathAssociationEndMappingData _newData = (MemberReferencePathAssociationEndMappingData) _behavior.getCurrentDataForRead(this);
this.zSetTxPersistenceState(PersistenceState.DETACHED_DELETED);
}
public void zSetNonTxDetachedDeleted()
{
TransactionalBehavior _behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary();
MemberReferencePathAssociationEndMappingData _newData = (MemberReferencePathAssociationEndMappingData) _behavior.getCurrentDataForRead(this);
this.zSetNonTxPersistenceState(PersistenceState.DETACHED_DELETED);
}
/**
* Relationship Expression:
this.associationOwningClassName = AssociationEnd.owningClassName and this.associationEndName = AssociationEnd.name
* @see AssociationEnd#getMemberReferencePaths() reverse relationship AssociationEnd.getMemberReferencePaths()
* @return The association end
*/
public AssociationEnd getAssociationEnd()
{
AssociationEnd _result = null;
Operation _op = null;
TransactionalBehavior _behavior = zGetTransactionalBehaviorForReadWithWaitIfNecessary();
MemberReferencePathAssociationEndMappingData _data = (MemberReferencePathAssociationEndMappingData) _behavior.getCurrentDataForRead(this);
MithraObjectPortal _portal = null;
if (_behavior.isPersisted())
{
{
_portal = AssociationEndFinder.getMithraObjectPortal();
Object _related = _portal.getAsOneFromCache(this, _data, forassociationEnd, null, null);
if (!(_related instanceof NulledRelation)) _result = (AssociationEnd) _related;
if (_related == null)
{
_op = new RelationshipMultiEqualityOperation(MemberReferencePathAssociationEndMappingFinder.associationEnd().zGetRelationshipMultiExtractor(), this);
}
}
}
else if (_behavior.isDetached())
{
{
{
Operation detachedOp = new RelationshipMultiEqualityOperation(MemberReferencePathAssociationEndMappingFinder.associationEnd().zGetRelationshipMultiExtractor(), this);
_result = AssociationEndFinder.zFindOneForRelationship(detachedOp);
}
}
}
else if (_behavior.isInMemory())
{
_result = (AssociationEnd) _data.getAssociationEnd();
if (_result == null)
{
{
_op = new RelationshipMultiEqualityOperation(MemberReferencePathAssociationEndMappingFinder.associationEnd().zGetRelationshipMultiExtractor(), this);
}
}
}
if (_op != null)
{
_result = AssociationEndFinder.zFindOneForRelationship(_op);
}
return _result;
}
public void setAssociationEnd(AssociationEnd associationEnd)
{
AssociationEnd _associationEnd = (AssociationEnd) associationEnd;
TransactionalBehavior _behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary();
MemberReferencePathAssociationEndMappingData _data = (MemberReferencePathAssociationEndMappingData) _behavior.getCurrentDataForWrite(this);
if (_behavior.isInMemory())
{
_data.setAssociationEnd(_associationEnd);
if (_associationEnd == null)
{
this.setAssociationOwningClassName(null);
this.setAssociationEndName(null);
}
else
{
this.setAssociationOwningClassName(_associationEnd.getOwningClassName());
this.setAssociationEndName(_associationEnd.getName());
}
}
else if (_behavior.isPersisted())
{
_behavior.clearTempTransaction(this);
if (_associationEnd == null)
{
this.setAssociationOwningClassName(null);
this.setAssociationEndName(null);
}
else
{
this.setAssociationOwningClassName(
_associationEnd.getOwningClassName());
this.setAssociationEndName(
_associationEnd.getName());
}
}
else throw new RuntimeException("not implemented");
}
/**
* Relationship Expression:
MemberReferencePath.id = this.memberReferencePathId
* @see MemberReferencePath#getAssociationEnds() reverse relationship MemberReferencePath.getAssociationEnds()
* @return The member reference path
*/
public MemberReferencePath getMemberReferencePath()
{
MemberReferencePath _result = null;
Operation _op = null;
TransactionalBehavior _behavior = zGetTransactionalBehaviorForReadWithWaitIfNecessary();
MemberReferencePathAssociationEndMappingData _data = (MemberReferencePathAssociationEndMappingData) _behavior.getCurrentDataForRead(this);
MithraObjectPortal _portal = null;
if (_behavior.isPersisted())
{
{
_portal = MemberReferencePathFinder.getMithraObjectPortal();
Object _related = _portal.getAsOneFromCache(this, _data, formemberReferencePath, null, null);
if (!(_related instanceof NulledRelation)) _result = (MemberReferencePath) _related;
if (_related == null)
{
_op = MemberReferencePathFinder.id().eq(_data.getMemberReferencePathId());
}
}
}
else if (_behavior.isDetached())
{
if (_data.getMemberReferencePath() instanceof NulledRelation)
{
return null;
}
_result = (MemberReferencePath) _data.getMemberReferencePath();
if (_result == null)
{
{
Operation detachedOp = MemberReferencePathFinder.id().eq(_data.getMemberReferencePathId());
_result = MemberReferencePathFinder.zFindOneForRelationship(detachedOp);
if(_result != null)
{
_result = _result.getDetachedCopy();
}
}
_data = (MemberReferencePathAssociationEndMappingData) _behavior.getCurrentDataForWrite(this);
_data.setMemberReferencePath(_result);
}
}
else if (_behavior.isInMemory())
{
_result = (MemberReferencePath) _data.getMemberReferencePath();
if (_result == null)
{
{
_op = MemberReferencePathFinder.id().eq(_data.getMemberReferencePathId());
}
}
}
if (_op != null)
{
_result = MemberReferencePathFinder.zFindOneForRelationship(_op);
}
return _result;
}
public void setMemberReferencePath(MemberReferencePath memberReferencePath)
{
MemberReferencePath _memberReferencePath = (MemberReferencePath) memberReferencePath;
TransactionalBehavior _behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary();
MemberReferencePathAssociationEndMappingData _data = (MemberReferencePathAssociationEndMappingData) _behavior.getCurrentDataForWrite(this);
if (_behavior.isInMemory())
{
Object _prev = _data.getMemberReferencePath();
if (_behavior.isDetached() && _prev != null)
{
((DelegatingList)((MemberReferencePath)_prev).getAssociationEnds()).zMarkMoved( (MemberReferencePathAssociationEndMapping) this);
}
_data.setMemberReferencePath(_memberReferencePath);
_memberReferencePath.getAssociationEnds().add( (MemberReferencePathAssociationEndMapping) this);
}
else if (_behavior.isPersisted())
{
_behavior.clearTempTransaction(this);
if (_memberReferencePath == null)
{
this.setMemberReferencePathId(0);
}
else
{
this.setMemberReferencePathId(
_memberReferencePath.getId());
}
}
else throw new RuntimeException("not implemented");
}
public void zSetParentContainermemberReferencePath(MemberReferencePathAbstract parent)
{
TransactionalBehavior _behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary();
MemberReferencePathAssociationEndMappingData _data = (MemberReferencePathAssociationEndMappingData) _behavior.getCurrentDataForWrite(this);
_behavior.clearTempTransaction(this);
if (_behavior.isInMemory())
{
_data.setMemberReferencePath(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 MemberReferencePathAssociationEndMapping zCascadeCopyThenInsert() throws MithraBusinessException
{
TransactionalBehavior _behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary();
MemberReferencePathAssociationEndMapping original = (MemberReferencePathAssociationEndMapping) _behavior.copyThenInsert(this);
return original;
}
protected void cascadeDeleteImpl() throws MithraBusinessException
{
this.delete();
}
public Cache zGetCache()
{
return MemberReferencePathAssociationEndMappingFinder.getMithraObjectPortal().getCache();
}
public MithraObjectPortal zGetPortal()
{
return MemberReferencePathAssociationEndMappingFinder.getMithraObjectPortal();
}
public MemberReferencePathAssociationEndMapping getOriginalPersistentObject()
{
return this.zFindOriginal();
}
protected boolean issueUpdatesForNonPrimaryKeys(TransactionalBehavior behavior, MithraDataObject data, MithraDataObject newData)
{
boolean changed = false;
changed |= zUpdateInteger(behavior, data, newData, MemberReferencePathAssociationEndMappingFinder.ordinal(), false);
return changed;
}
protected boolean issueUpdatesForPrimaryKeys(TransactionalBehavior behavior, MithraDataObject data, MithraDataObject newData)
{
boolean changed = false;
changed |= zUpdateString(behavior, data, newData, MemberReferencePathAssociationEndMappingFinder.associationEndName(), false);
changed |= zUpdateString(behavior, data, newData, MemberReferencePathAssociationEndMappingFinder.associationOwningClassName(), false);
changed |= zUpdateLong(behavior, data, newData, MemberReferencePathAssociationEndMappingFinder.memberReferencePathId(), false);
return changed;
}
public Object readResolve() throws ObjectStreamException
{
MemberReferencePathAssociationEndMappingAbstract result = (MemberReferencePathAssociationEndMappingAbstract) 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