klass.model.meta.domain.ThisMemberReferencePathAbstract 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 ThisMemberReferencePathAbstract 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(ThisMemberReferencePath.class.getName());
private static final RelationshipHashStrategy formemberReferencePathSuperClass = new MemberReferencePathSuperClassRhs();
private static final class MemberReferencePathSuperClassRhs implements RelationshipHashStrategy
{
public boolean equalsForRelationship(Object _srcObject, Object _srcData, Object _targetData, Timestamp _asOfDate0, Timestamp _asOfDate1)
{
ThisMemberReferencePathData _castedSrcData = (ThisMemberReferencePathData) _srcData;
MemberReferencePathData _castedTargetData = (MemberReferencePathData) _targetData;
if (_castedSrcData.getId() == _castedTargetData.getId())
{
return true;
}
return false;
}
public int computeHashCodeFromRelated(Object _srcObject, Object _srcData)
{
ThisMemberReferencePathData _castedSrcData = (ThisMemberReferencePathData) _srcData;
return HashUtil.hash(_castedSrcData.getId());
}
public int computeOffHeapHashCodeFromRelated(Object _srcObject, Object _srcData)
{
return computeHashCodeFromRelated(_srcObject, _srcData);
}
}
public ThisMemberReferencePathAbstract()
{
this.persistenceState = MEMORY_STATE;
}
public ThisMemberReferencePath getDetachedCopy() throws MithraBusinessException
{
return (ThisMemberReferencePath) super.getDetachedCopy();
}
public ThisMemberReferencePath getNonPersistentCopy() throws MithraBusinessException
{
ThisMemberReferencePath result = (ThisMemberReferencePath) super.getNonPersistentCopy();
result.persistenceState = MEMORY_STATE;
return result;
}
public ThisMemberReferencePath copyDetachedValuesToOriginalOrInsertIfNew()
{
return (ThisMemberReferencePath) this.zCopyDetachedValuesToOriginalOrInsertIfNew();
}
public ThisMemberReferencePath zFindOriginal()
{
ThisMemberReferencePathData data = (ThisMemberReferencePathData) this.currentData;
Operation op;
op = ThisMemberReferencePathFinder.id().eq(data.getId());
return ThisMemberReferencePathFinder.findOne(op);
}
public boolean isModifiedSinceDetachmentByDependentRelationships()
{
if(this.isModifiedSinceDetachment()) return true;
return false;
}
private Logger getLogger()
{
return logger;
}
public MithraDataObject zAllocateData()
{
return new ThisMemberReferencePathData();
}
protected void zSetFromThisMemberReferencePathData( ThisMemberReferencePathData data )
{
super.zSetData(data);
this.persistenceState = PERSISTED_STATE;
}
public void setFromThisMemberReferencePathData( ThisMemberReferencePathData data )
{
super.zSetData(data);
}
public void zWriteDataClassName(ObjectOutput out) throws IOException
{
}
public final boolean isIdNull()
{
return ((ThisMemberReferencePathData) this.zSynchronizedGetData()).isIdNull();
}
public final long getId()
{
ThisMemberReferencePathData data = (ThisMemberReferencePathData) this.zSynchronizedGetData();
return data.getId();
}
public void setId(long newValue)
{
zSetLong(ThisMemberReferencePathFinder.id(), newValue, true, false ,false);
}
protected void issuePrimitiveNullSetters(TransactionalBehavior behavior, MithraDataObject data)
{
}
public void zPersistDetachedRelationships(MithraDataObject _data)
{
ThisMemberReferencePathData _newData = (ThisMemberReferencePathData) _data;
}
public void zSetTxDetachedDeleted()
{
TransactionalBehavior _behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary();
if (_behavior.isDetached() && _behavior.isDeleted()) return;
ThisMemberReferencePathData _newData = (ThisMemberReferencePathData) _behavior.getCurrentDataForRead(this);
this.zSetTxPersistenceState(PersistenceState.DETACHED_DELETED);
}
public void zSetNonTxDetachedDeleted()
{
TransactionalBehavior _behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary();
ThisMemberReferencePathData _newData = (ThisMemberReferencePathData) _behavior.getCurrentDataForRead(this);
this.zSetNonTxPersistenceState(PersistenceState.DETACHED_DELETED);
}
/**
* Relationship Expression:
AssociationEndOrderBy.thisMemberReferencePathId = this.id
* @see AssociationEndOrderBy#getThisMemberReferencePath() reverse relationship AssociationEndOrderBy.getThisMemberReferencePath()
* @return The association end order by
*/
public AssociationEndOrderBy getAssociationEndOrderBy()
{
AssociationEndOrderBy _result = null;
Operation _op = null;
TransactionalBehavior _behavior = zGetTransactionalBehaviorForReadWithWaitIfNecessary();
ThisMemberReferencePathData _data = (ThisMemberReferencePathData) _behavior.getCurrentDataForRead(this);
if (_behavior.isPersisted())
{
{
{
_op = AssociationEndOrderByFinder.thisMemberReferencePathId().eq(_data.getId());
}
}
}
else if (_behavior.isDetached())
{
{
{
Operation detachedOp = AssociationEndOrderByFinder.thisMemberReferencePathId().eq(_data.getId());
_result = AssociationEndOrderByFinder.zFindOneForRelationship(detachedOp);
}
}
}
else if (_behavior.isInMemory())
{
_result = (AssociationEndOrderBy) _data.getAssociationEndOrderBy();
if (_result == null)
{
{
_op = AssociationEndOrderByFinder.thisMemberReferencePathId().eq(_data.getId());
}
}
}
if (_op != null)
{
_result = AssociationEndOrderByFinder.zFindOneForRelationship(_op);
}
return _result;
}
public void setAssociationEndOrderBy(AssociationEndOrderBy associationEndOrderBy)
{
AssociationEndOrderBy _associationEndOrderBy = (AssociationEndOrderBy) associationEndOrderBy;
TransactionalBehavior _behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary();
ThisMemberReferencePathData _data = (ThisMemberReferencePathData) _behavior.getCurrentDataForWrite(this);
if (_behavior.isInMemory())
{
_data.setAssociationEndOrderBy(_associationEndOrderBy);
if (_associationEndOrderBy == null)
{
this.setId(0);
}
else
{
this.setId(_associationEndOrderBy.getThisMemberReferencePathId());
}
}
else if (_behavior.isPersisted())
{
_behavior.clearTempTransaction(this);
if (_associationEndOrderBy == null)
{
this.setId(0);
}
else
{
this.setId(
_associationEndOrderBy.getThisMemberReferencePathId());
}
}
else throw new RuntimeException("not implemented");
}
/**
* Relationship Expression:
MemberReferencePath.id = this.id
* @see MemberReferencePath#getThisMemberReferencePathSubClass() reverse relationship MemberReferencePath.getThisMemberReferencePathSubClass()
* @return The member reference path super class
*/
public MemberReferencePath getMemberReferencePathSuperClass()
{
MemberReferencePath _result = null;
Operation _op = null;
TransactionalBehavior _behavior = zGetTransactionalBehaviorForReadWithWaitIfNecessary();
ThisMemberReferencePathData _data = (ThisMemberReferencePathData) _behavior.getCurrentDataForRead(this);
MithraObjectPortal _portal = null;
if (_behavior.isPersisted())
{
{
_portal = MemberReferencePathFinder.getMithraObjectPortal();
Object _related = _portal.getAsOneFromCache(this, _data, formemberReferencePathSuperClass, null, null);
if (!(_related instanceof NulledRelation)) _result = (MemberReferencePath) _related;
if (_related == null)
{
_op = MemberReferencePathFinder.id().eq(_data.getId());
}
}
}
else if (_behavior.isDetached())
{
if (_data.getMemberReferencePathSuperClass() instanceof NulledRelation)
{
return null;
}
_result = (MemberReferencePath) _data.getMemberReferencePathSuperClass();
if (_result == null)
{
{
Operation detachedOp = MemberReferencePathFinder.id().eq(_data.getId());
_result = MemberReferencePathFinder.zFindOneForRelationship(detachedOp);
if(_result != null)
{
_result = _result.getDetachedCopy();
}
}
_data = (ThisMemberReferencePathData) _behavior.getCurrentDataForWrite(this);
_data.setMemberReferencePathSuperClass(_result);
}
}
else if (_behavior.isInMemory())
{
_result = (MemberReferencePath) _data.getMemberReferencePathSuperClass();
if (_result == null)
{
{
_op = MemberReferencePathFinder.id().eq(_data.getId());
}
}
}
if (_op != null)
{
_result = MemberReferencePathFinder.zFindOneForRelationship(_op);
}
return _result;
}
public void setMemberReferencePathSuperClass(MemberReferencePath memberReferencePathSuperClass)
{
((MemberReferencePath)memberReferencePathSuperClass).setThisMemberReferencePathSubClass((ThisMemberReferencePath)this);
}
public void zSetParentContainermemberReferencePathSuperClass(MemberReferencePathAbstract parent)
{
TransactionalBehavior _behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary();
ThisMemberReferencePathData _data = (ThisMemberReferencePathData) _behavior.getCurrentDataForWrite(this);
_behavior.clearTempTransaction(this);
if (_behavior.isInMemory())
{
_data.setMemberReferencePathSuperClass(parent);
}
}
/**
* Relationship Expression:
ServiceOrderBy.thisMemberReferencePathId = this.id
* @see ServiceOrderBy#getThisMemberReferencePath() reverse relationship ServiceOrderBy.getThisMemberReferencePath()
* @return The service order by
*/
public ServiceOrderBy getServiceOrderBy()
{
ServiceOrderBy _result = null;
Operation _op = null;
TransactionalBehavior _behavior = zGetTransactionalBehaviorForReadWithWaitIfNecessary();
ThisMemberReferencePathData _data = (ThisMemberReferencePathData) _behavior.getCurrentDataForRead(this);
if (_behavior.isPersisted())
{
{
{
_op = ServiceOrderByFinder.thisMemberReferencePathId().eq(_data.getId());
}
}
}
else if (_behavior.isDetached())
{
{
{
Operation detachedOp = ServiceOrderByFinder.thisMemberReferencePathId().eq(_data.getId());
_result = ServiceOrderByFinder.zFindOneForRelationship(detachedOp);
}
}
}
else if (_behavior.isInMemory())
{
_result = (ServiceOrderBy) _data.getServiceOrderBy();
if (_result == null)
{
{
_op = ServiceOrderByFinder.thisMemberReferencePathId().eq(_data.getId());
}
}
}
if (_op != null)
{
_result = ServiceOrderByFinder.zFindOneForRelationship(_op);
}
return _result;
}
public void setServiceOrderBy(ServiceOrderBy serviceOrderBy)
{
ServiceOrderBy _serviceOrderBy = (ServiceOrderBy) serviceOrderBy;
TransactionalBehavior _behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary();
ThisMemberReferencePathData _data = (ThisMemberReferencePathData) _behavior.getCurrentDataForWrite(this);
if (_behavior.isInMemory())
{
_data.setServiceOrderBy(_serviceOrderBy);
if (_serviceOrderBy == null)
{
this.setId(0);
}
else
{
this.setId(_serviceOrderBy.getThisMemberReferencePathId());
}
}
else if (_behavior.isPersisted())
{
_behavior.clearTempTransaction(this);
if (_serviceOrderBy == null)
{
this.setId(0);
}
else
{
this.setId(
_serviceOrderBy.getThisMemberReferencePathId());
}
}
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 ThisMemberReferencePath zCascadeCopyThenInsert() throws MithraBusinessException
{
TransactionalBehavior _behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary();
ThisMemberReferencePath original = (ThisMemberReferencePath) _behavior.copyThenInsert(this);
return original;
}
protected void cascadeDeleteImpl() throws MithraBusinessException
{
this.delete();
}
public Cache zGetCache()
{
return ThisMemberReferencePathFinder.getMithraObjectPortal().getCache();
}
public MithraObjectPortal zGetPortal()
{
return ThisMemberReferencePathFinder.getMithraObjectPortal();
}
public ThisMemberReferencePath getOriginalPersistentObject()
{
return this.zFindOriginal();
}
protected boolean issueUpdatesForNonPrimaryKeys(TransactionalBehavior behavior, MithraDataObject data, MithraDataObject newData)
{
boolean changed = false;
return changed;
}
protected boolean issueUpdatesForPrimaryKeys(TransactionalBehavior behavior, MithraDataObject data, MithraDataObject newData)
{
boolean changed = false;
changed |= zUpdateLong(behavior, data, newData, ThisMemberReferencePathFinder.id(), false);
return changed;
}
public Object readResolve() throws ObjectStreamException
{
ThisMemberReferencePathAbstract result = (ThisMemberReferencePathAbstract) 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