klass.model.meta.domain.ServiceOrderByAbstract 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 ServiceOrderByAbstract 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(ServiceOrderBy.class.getName());
private static final RelationshipHashStrategy forthisMemberReferencePath = new ThisMemberReferencePathRhs();
private static final RelationshipHashStrategy forservice = new ServiceRhs();
private static final class ThisMemberReferencePathRhs implements RelationshipHashStrategy
{
public boolean equalsForRelationship(Object _srcObject, Object _srcData, Object _targetData, Timestamp _asOfDate0, Timestamp _asOfDate1)
{
ServiceOrderByData _castedSrcData = (ServiceOrderByData) _srcData;
ThisMemberReferencePathData _castedTargetData = (ThisMemberReferencePathData) _targetData;
if (_castedSrcData.getThisMemberReferencePathId() == _castedTargetData.getId())
{
return true;
}
return false;
}
public int computeHashCodeFromRelated(Object _srcObject, Object _srcData)
{
ServiceOrderByData _castedSrcData = (ServiceOrderByData) _srcData;
return HashUtil.hash(_castedSrcData.getThisMemberReferencePathId());
}
public int computeOffHeapHashCodeFromRelated(Object _srcObject, Object _srcData)
{
return computeHashCodeFromRelated(_srcObject, _srcData);
}
}
private static final class ServiceRhs implements RelationshipHashStrategy
{
public boolean equalsForRelationship(Object _srcObject, Object _srcData, Object _targetData, Timestamp _asOfDate0, Timestamp _asOfDate1)
{
ServiceOrderByData _castedSrcData = (ServiceOrderByData) _srcData;
ServiceData _castedTargetData = (ServiceData) _targetData;
if (_castedSrcData.getServiceGroupName()!= null && _castedSrcData.getServiceGroupName().equals(_castedTargetData.getServiceGroupName()) && _castedSrcData.getServiceUrlString()!= null && _castedSrcData.getServiceUrlString().equals(_castedTargetData.getUrlString()) && _castedSrcData.getServiceVerb()!= null && _castedSrcData.getServiceVerb().equals(_castedTargetData.getVerb()))
{
return true;
}
return false;
}
public int computeHashCodeFromRelated(Object _srcObject, Object _srcData)
{
ServiceOrderByData _castedSrcData = (ServiceOrderByData) _srcData;
return HashUtil.combineHashes(HashUtil.combineHashes(HashUtil.hash(_castedSrcData.getServiceGroupName()),HashUtil.hash(_castedSrcData.getServiceUrlString())),HashUtil.hash(_castedSrcData.getServiceVerb()));
}
public int computeOffHeapHashCodeFromRelated(Object _srcObject, Object _srcData)
{
ServiceOrderByData _castedSrcData = (ServiceOrderByData) _srcData;
return HashUtil.combineHashes(HashUtil.combineHashes(HashUtil.offHeapHash(_castedSrcData.getServiceGroupName()),HashUtil.offHeapHash(_castedSrcData.getServiceUrlString())),HashUtil.offHeapHash(_castedSrcData.getServiceVerb()));
}
}
public ServiceOrderByAbstract()
{
this.persistenceState = MEMORY_STATE;
}
public ServiceOrderBy getDetachedCopy() throws MithraBusinessException
{
return (ServiceOrderBy) super.getDetachedCopy();
}
public ServiceOrderBy getNonPersistentCopy() throws MithraBusinessException
{
ServiceOrderBy result = (ServiceOrderBy) super.getNonPersistentCopy();
result.persistenceState = MEMORY_STATE;
return result;
}
public ServiceOrderBy copyDetachedValuesToOriginalOrInsertIfNew()
{
return (ServiceOrderBy) this.zCopyDetachedValuesToOriginalOrInsertIfNew();
}
public ServiceOrderBy zFindOriginal()
{
ServiceOrderByData data = (ServiceOrderByData) this.currentData;
Operation op;
op = ServiceOrderByFinder.serviceGroupName().eq(data.getServiceGroupName());
op = op.and(ServiceOrderByFinder.serviceUrlString().eq(data.getServiceUrlString()));
op = op.and(ServiceOrderByFinder.serviceVerb().eq(data.getServiceVerb()));
op = op.and(ServiceOrderByFinder.thisMemberReferencePathId().eq(data.getThisMemberReferencePathId()));
return ServiceOrderByFinder.findOne(op);
}
public boolean isModifiedSinceDetachmentByDependentRelationships()
{
if(this.isModifiedSinceDetachment()) return true;
return false;
}
private Logger getLogger()
{
return logger;
}
public MithraDataObject zAllocateData()
{
return new ServiceOrderByData();
}
protected void zSetFromServiceOrderByData( ServiceOrderByData data )
{
super.zSetData(data);
this.persistenceState = PERSISTED_STATE;
}
public void setFromServiceOrderByData( ServiceOrderByData data )
{
super.zSetData(data);
}
public void zWriteDataClassName(ObjectOutput out) throws IOException
{
}
public boolean isOrderByDirectionNull()
{
return ((ServiceOrderByData) this.zSynchronizedGetData()).isOrderByDirectionNull();
}
public String getOrderByDirection()
{
ServiceOrderByData data = (ServiceOrderByData) this.zSynchronizedGetData();
return data.getOrderByDirection();
}
public void setOrderByDirection(String newValue)
{
zSetString(ServiceOrderByFinder.orderByDirection(), newValue, false, false );
}
public boolean isOrdinalNull()
{
return ((ServiceOrderByData) this.zSynchronizedGetData()).isOrdinalNull();
}
public int getOrdinal()
{
ServiceOrderByData data = (ServiceOrderByData) this.zSynchronizedGetData();
return data.getOrdinal();
}
public void setOrdinal(int newValue)
{
zSetInteger(ServiceOrderByFinder.ordinal(), newValue, false, false ,false);
}
public final boolean isServiceGroupNameNull()
{
return ((ServiceOrderByData) this.zSynchronizedGetData()).isServiceGroupNameNull();
}
public final String getServiceGroupName()
{
ServiceOrderByData data = (ServiceOrderByData) this.zSynchronizedGetData();
return data.getServiceGroupName();
}
public void setServiceGroupName(String newValue)
{
if (newValue != null && newValue.length() > 256)
throw new MithraBusinessException("Attribute 'serviceGroupName' cannot exceed maximum length of 256: " + newValue);
zSetString(ServiceOrderByFinder.serviceGroupName(), newValue, true, false );
}
public final boolean isServiceUrlStringNull()
{
return ((ServiceOrderByData) this.zSynchronizedGetData()).isServiceUrlStringNull();
}
public final String getServiceUrlString()
{
ServiceOrderByData data = (ServiceOrderByData) this.zSynchronizedGetData();
return data.getServiceUrlString();
}
public void setServiceUrlString(String newValue)
{
if (newValue != null && newValue.length() > 8192)
throw new MithraBusinessException("Attribute 'serviceUrlString' cannot exceed maximum length of 8192: " + newValue);
zSetString(ServiceOrderByFinder.serviceUrlString(), newValue, true, false );
}
public final boolean isServiceVerbNull()
{
return ((ServiceOrderByData) this.zSynchronizedGetData()).isServiceVerbNull();
}
public final String getServiceVerb()
{
ServiceOrderByData data = (ServiceOrderByData) this.zSynchronizedGetData();
return data.getServiceVerb();
}
public void setServiceVerb(String newValue)
{
zSetString(ServiceOrderByFinder.serviceVerb(), newValue, true, false );
}
public final boolean isThisMemberReferencePathIdNull()
{
return ((ServiceOrderByData) this.zSynchronizedGetData()).isThisMemberReferencePathIdNull();
}
public final long getThisMemberReferencePathId()
{
ServiceOrderByData data = (ServiceOrderByData) this.zSynchronizedGetData();
return data.getThisMemberReferencePathId();
}
public void setThisMemberReferencePathId(long newValue)
{
zSetLong(ServiceOrderByFinder.thisMemberReferencePathId(), newValue, true, false ,false);
}
protected void issuePrimitiveNullSetters(TransactionalBehavior behavior, MithraDataObject data)
{
}
public void zPersistDetachedRelationships(MithraDataObject _data)
{
ServiceOrderByData _newData = (ServiceOrderByData) _data;
}
public void zSetTxDetachedDeleted()
{
TransactionalBehavior _behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary();
if (_behavior.isDetached() && _behavior.isDeleted()) return;
ServiceOrderByData _newData = (ServiceOrderByData) _behavior.getCurrentDataForRead(this);
this.zSetTxPersistenceState(PersistenceState.DETACHED_DELETED);
}
public void zSetNonTxDetachedDeleted()
{
TransactionalBehavior _behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary();
ServiceOrderByData _newData = (ServiceOrderByData) _behavior.getCurrentDataForRead(this);
this.zSetNonTxPersistenceState(PersistenceState.DETACHED_DELETED);
}
/**
* Relationship Expression:
this.thisMemberReferencePathId = ThisMemberReferencePath.id
* @see ThisMemberReferencePath#getServiceOrderBy() reverse relationship ThisMemberReferencePath.getServiceOrderBy()
* @return The this member reference path
*/
public ThisMemberReferencePath getThisMemberReferencePath()
{
ThisMemberReferencePath _result = null;
Operation _op = null;
TransactionalBehavior _behavior = zGetTransactionalBehaviorForReadWithWaitIfNecessary();
ServiceOrderByData _data = (ServiceOrderByData) _behavior.getCurrentDataForRead(this);
MithraObjectPortal _portal = null;
if (_behavior.isPersisted())
{
{
_portal = ThisMemberReferencePathFinder.getMithraObjectPortal();
Object _related = _portal.getAsOneFromCache(this, _data, forthisMemberReferencePath, null, null);
if (!(_related instanceof NulledRelation)) _result = (ThisMemberReferencePath) _related;
if (_related == null)
{
_op = ThisMemberReferencePathFinder.id().eq(_data.getThisMemberReferencePathId());
}
}
}
else if (_behavior.isDetached())
{
{
{
Operation detachedOp = ThisMemberReferencePathFinder.id().eq(_data.getThisMemberReferencePathId());
_result = ThisMemberReferencePathFinder.zFindOneForRelationship(detachedOp);
}
}
}
else if (_behavior.isInMemory())
{
_result = (ThisMemberReferencePath) _data.getThisMemberReferencePath();
if (_result == null)
{
{
_op = ThisMemberReferencePathFinder.id().eq(_data.getThisMemberReferencePathId());
}
}
}
if (_op != null)
{
_result = ThisMemberReferencePathFinder.zFindOneForRelationship(_op);
}
return _result;
}
public void setThisMemberReferencePath(ThisMemberReferencePath thisMemberReferencePath)
{
ThisMemberReferencePath _thisMemberReferencePath = (ThisMemberReferencePath) thisMemberReferencePath;
TransactionalBehavior _behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary();
ServiceOrderByData _data = (ServiceOrderByData) _behavior.getCurrentDataForWrite(this);
if (_behavior.isInMemory())
{
_data.setThisMemberReferencePath(_thisMemberReferencePath);
if (_thisMemberReferencePath == null)
{
this.setThisMemberReferencePathId(0);
}
else
{
this.setThisMemberReferencePathId(_thisMemberReferencePath.getId());
}
}
else if (_behavior.isPersisted())
{
_behavior.clearTempTransaction(this);
if (_thisMemberReferencePath == null)
{
this.setThisMemberReferencePathId(0);
}
else
{
this.setThisMemberReferencePathId(
_thisMemberReferencePath.getId());
}
}
else throw new RuntimeException("not implemented");
}
/**
* Relationship Expression:
(Service.serviceGroupName = this.serviceGroupName and Service.urlString = this.serviceUrlString and Service.verb = this.serviceVerb )
* @see Service#getOrderBys() reverse relationship Service.getOrderBys()
* @return The service
*/
public Service getService()
{
Service _result = null;
Operation _op = null;
TransactionalBehavior _behavior = zGetTransactionalBehaviorForReadWithWaitIfNecessary();
ServiceOrderByData _data = (ServiceOrderByData) _behavior.getCurrentDataForRead(this);
MithraObjectPortal _portal = null;
if (_behavior.isPersisted())
{
{
_portal = ServiceFinder.getMithraObjectPortal();
Object _related = _portal.getAsOneFromCache(this, _data, forservice, null, null);
if (!(_related instanceof NulledRelation)) _result = (Service) _related;
if (_related == null)
{
_op = new RelationshipMultiEqualityOperation(ServiceOrderByFinder.service().zGetRelationshipMultiExtractor(), this);
}
}
}
else if (_behavior.isDetached())
{
if (_data.getService() instanceof NulledRelation)
{
return null;
}
_result = (Service) _data.getService();
if (_result == null)
{
{
Operation detachedOp = new RelationshipMultiEqualityOperation(ServiceOrderByFinder.service().zGetRelationshipMultiExtractor(), this);
_result = ServiceFinder.zFindOneForRelationship(detachedOp);
if(_result != null)
{
_result = _result.getDetachedCopy();
}
}
_data = (ServiceOrderByData) _behavior.getCurrentDataForWrite(this);
_data.setService(_result);
}
}
else if (_behavior.isInMemory())
{
_result = (Service) _data.getService();
if (_result == null)
{
{
_op = new RelationshipMultiEqualityOperation(ServiceOrderByFinder.service().zGetRelationshipMultiExtractor(), this);
}
}
}
if (_op != null)
{
_result = ServiceFinder.zFindOneForRelationship(_op);
}
return _result;
}
public void setService(Service service)
{
Service _service = (Service) service;
TransactionalBehavior _behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary();
ServiceOrderByData _data = (ServiceOrderByData) _behavior.getCurrentDataForWrite(this);
if (_behavior.isInMemory())
{
Object _prev = _data.getService();
if (_behavior.isDetached() && _prev != null)
{
((DelegatingList)((Service)_prev).getOrderBys()).zMarkMoved( (ServiceOrderBy) this);
}
_data.setService(_service);
_service.getOrderBys().add( (ServiceOrderBy) this);
}
else if (_behavior.isPersisted())
{
_behavior.clearTempTransaction(this);
if (_service == null)
{
this.setServiceGroupName(null);
this.setServiceUrlString(null);
this.setServiceVerb(null);
}
else
{
this.setServiceGroupName(
_service.getServiceGroupName());
this.setServiceUrlString(
_service.getUrlString());
this.setServiceVerb(
_service.getVerb());
}
}
else throw new RuntimeException("not implemented");
}
public void zSetParentContainerservice(ServiceAbstract parent)
{
TransactionalBehavior _behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary();
ServiceOrderByData _data = (ServiceOrderByData) _behavior.getCurrentDataForWrite(this);
_behavior.clearTempTransaction(this);
if (_behavior.isInMemory())
{
_data.setService(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 ServiceOrderBy zCascadeCopyThenInsert() throws MithraBusinessException
{
TransactionalBehavior _behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary();
ServiceOrderBy original = (ServiceOrderBy) _behavior.copyThenInsert(this);
return original;
}
protected void cascadeDeleteImpl() throws MithraBusinessException
{
this.delete();
}
public Cache zGetCache()
{
return ServiceOrderByFinder.getMithraObjectPortal().getCache();
}
public MithraObjectPortal zGetPortal()
{
return ServiceOrderByFinder.getMithraObjectPortal();
}
public ServiceOrderBy getOriginalPersistentObject()
{
return this.zFindOriginal();
}
protected boolean issueUpdatesForNonPrimaryKeys(TransactionalBehavior behavior, MithraDataObject data, MithraDataObject newData)
{
boolean changed = false;
changed |= zUpdateString(behavior, data, newData, ServiceOrderByFinder.orderByDirection(), false);
changed |= zUpdateInteger(behavior, data, newData, ServiceOrderByFinder.ordinal(), false);
return changed;
}
protected boolean issueUpdatesForPrimaryKeys(TransactionalBehavior behavior, MithraDataObject data, MithraDataObject newData)
{
boolean changed = false;
changed |= zUpdateString(behavior, data, newData, ServiceOrderByFinder.serviceGroupName(), false);
changed |= zUpdateString(behavior, data, newData, ServiceOrderByFinder.serviceUrlString(), false);
changed |= zUpdateString(behavior, data, newData, ServiceOrderByFinder.serviceVerb(), false);
changed |= zUpdateLong(behavior, data, newData, ServiceOrderByFinder.thisMemberReferencePathId(), false);
return changed;
}
public Object readResolve() throws ObjectStreamException
{
ServiceOrderByAbstract result = (ServiceOrderByAbstract) 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