klass.model.meta.domain.UrlParameterAbstract 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 UrlParameterAbstract 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(UrlParameter.class.getName());
private static final RelationshipHashStrategy forparameter = new ParameterRhs();
private static final RelationshipHashStrategy forurl = new UrlRhs();
private static final class ParameterRhs implements RelationshipHashStrategy
{
public boolean equalsForRelationship(Object _srcObject, Object _srcData, Object _targetData, Timestamp _asOfDate0, Timestamp _asOfDate1)
{
UrlParameterData _castedSrcData = (UrlParameterData) _srcData;
ParameterData _castedTargetData = (ParameterData) _targetData;
if (_castedSrcData.getParameterId() == _castedTargetData.getId())
{
return true;
}
return false;
}
public int computeHashCodeFromRelated(Object _srcObject, Object _srcData)
{
UrlParameterData _castedSrcData = (UrlParameterData) _srcData;
return HashUtil.hash(_castedSrcData.getParameterId());
}
public int computeOffHeapHashCodeFromRelated(Object _srcObject, Object _srcData)
{
return computeHashCodeFromRelated(_srcObject, _srcData);
}
}
private static final class UrlRhs implements RelationshipHashStrategy
{
public boolean equalsForRelationship(Object _srcObject, Object _srcData, Object _targetData, Timestamp _asOfDate0, Timestamp _asOfDate1)
{
UrlParameterData _castedSrcData = (UrlParameterData) _srcData;
UrlData _castedTargetData = (UrlData) _targetData;
if (_castedSrcData.getServiceGroupName()!= null && _castedSrcData.getServiceGroupName().equals(_castedTargetData.getServiceGroupName()) && _castedSrcData.getUrlString()!= null && _castedSrcData.getUrlString().equals(_castedTargetData.getUrl()))
{
return true;
}
return false;
}
public int computeHashCodeFromRelated(Object _srcObject, Object _srcData)
{
UrlParameterData _castedSrcData = (UrlParameterData) _srcData;
return HashUtil.combineHashes(HashUtil.hash(_castedSrcData.getServiceGroupName()),HashUtil.hash(_castedSrcData.getUrlString()));
}
public int computeOffHeapHashCodeFromRelated(Object _srcObject, Object _srcData)
{
UrlParameterData _castedSrcData = (UrlParameterData) _srcData;
return HashUtil.combineHashes(HashUtil.offHeapHash(_castedSrcData.getServiceGroupName()),HashUtil.offHeapHash(_castedSrcData.getUrlString()));
}
}
public UrlParameterAbstract()
{
this.persistenceState = MEMORY_STATE;
}
public UrlParameter getDetachedCopy() throws MithraBusinessException
{
return (UrlParameter) super.getDetachedCopy();
}
public UrlParameter getNonPersistentCopy() throws MithraBusinessException
{
UrlParameter result = (UrlParameter) super.getNonPersistentCopy();
result.persistenceState = MEMORY_STATE;
return result;
}
public UrlParameter copyDetachedValuesToOriginalOrInsertIfNew()
{
return (UrlParameter) this.zCopyDetachedValuesToOriginalOrInsertIfNew();
}
public UrlParameter zFindOriginal()
{
UrlParameterData data = (UrlParameterData) this.currentData;
Operation op;
op = UrlParameterFinder.serviceGroupName().eq(data.getServiceGroupName());
op = op.and(UrlParameterFinder.urlString().eq(data.getUrlString()));
op = op.and(UrlParameterFinder.parameterId().eq(data.getParameterId()));
return UrlParameterFinder.findOne(op);
}
public boolean isModifiedSinceDetachmentByDependentRelationships()
{
if(this.isModifiedSinceDetachment()) return true;
return false;
}
private Logger getLogger()
{
return logger;
}
public MithraDataObject zAllocateData()
{
return new UrlParameterData();
}
protected void zSetFromUrlParameterData( UrlParameterData data )
{
super.zSetData(data);
this.persistenceState = PERSISTED_STATE;
}
public void setFromUrlParameterData( UrlParameterData data )
{
super.zSetData(data);
}
public void zWriteDataClassName(ObjectOutput out) throws IOException
{
}
public boolean isOrdinalNull()
{
return ((UrlParameterData) this.zSynchronizedGetData()).isOrdinalNull();
}
public int getOrdinal()
{
UrlParameterData data = (UrlParameterData) this.zSynchronizedGetData();
return data.getOrdinal();
}
public void setOrdinal(int newValue)
{
zSetInteger(UrlParameterFinder.ordinal(), newValue, false, false ,false);
}
public final boolean isParameterIdNull()
{
return ((UrlParameterData) this.zSynchronizedGetData()).isParameterIdNull();
}
public final long getParameterId()
{
UrlParameterData data = (UrlParameterData) this.zSynchronizedGetData();
return data.getParameterId();
}
public void setParameterId(long newValue)
{
zSetLong(UrlParameterFinder.parameterId(), newValue, true, false ,false);
}
public final boolean isServiceGroupNameNull()
{
return ((UrlParameterData) this.zSynchronizedGetData()).isServiceGroupNameNull();
}
public final String getServiceGroupName()
{
UrlParameterData data = (UrlParameterData) 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(UrlParameterFinder.serviceGroupName(), newValue, true, false );
}
public boolean isTypeNull()
{
return ((UrlParameterData) this.zSynchronizedGetData()).isTypeNull();
}
public String getType()
{
UrlParameterData data = (UrlParameterData) this.zSynchronizedGetData();
return data.getType();
}
public void setType(String newValue)
{
zSetString(UrlParameterFinder.type(), newValue, false, false );
}
public final boolean isUrlStringNull()
{
return ((UrlParameterData) this.zSynchronizedGetData()).isUrlStringNull();
}
public final String getUrlString()
{
UrlParameterData data = (UrlParameterData) this.zSynchronizedGetData();
return data.getUrlString();
}
public void setUrlString(String newValue)
{
if (newValue != null && newValue.length() > 8192)
throw new MithraBusinessException("Attribute 'urlString' cannot exceed maximum length of 8192: " + newValue);
zSetString(UrlParameterFinder.urlString(), newValue, true, false );
}
protected void issuePrimitiveNullSetters(TransactionalBehavior behavior, MithraDataObject data)
{
}
public void zPersistDetachedRelationships(MithraDataObject _data)
{
UrlParameterData _newData = (UrlParameterData) _data;
}
public void zSetTxDetachedDeleted()
{
TransactionalBehavior _behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary();
if (_behavior.isDetached() && _behavior.isDeleted()) return;
UrlParameterData _newData = (UrlParameterData) _behavior.getCurrentDataForRead(this);
this.zSetTxPersistenceState(PersistenceState.DETACHED_DELETED);
}
public void zSetNonTxDetachedDeleted()
{
TransactionalBehavior _behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary();
UrlParameterData _newData = (UrlParameterData) _behavior.getCurrentDataForRead(this);
this.zSetNonTxPersistenceState(PersistenceState.DETACHED_DELETED);
}
/**
* Relationship Expression:
this.parameterId = Parameter.id
* @see Parameter#getUrlParameter() reverse relationship Parameter.getUrlParameter()
* @return The parameter
*/
public Parameter getParameter()
{
Parameter _result = null;
Operation _op = null;
TransactionalBehavior _behavior = zGetTransactionalBehaviorForReadWithWaitIfNecessary();
UrlParameterData _data = (UrlParameterData) _behavior.getCurrentDataForRead(this);
MithraObjectPortal _portal = null;
if (_behavior.isPersisted())
{
{
_portal = ParameterFinder.getMithraObjectPortal();
Object _related = _portal.getAsOneFromCache(this, _data, forparameter, null, null);
if (!(_related instanceof NulledRelation)) _result = (Parameter) _related;
if (_related == null)
{
_op = ParameterFinder.id().eq(_data.getParameterId());
}
}
}
else if (_behavior.isDetached())
{
{
{
Operation detachedOp = ParameterFinder.id().eq(_data.getParameterId());
_result = ParameterFinder.zFindOneForRelationship(detachedOp);
}
}
}
else if (_behavior.isInMemory())
{
_result = (Parameter) _data.getParameter();
if (_result == null)
{
{
_op = ParameterFinder.id().eq(_data.getParameterId());
}
}
}
if (_op != null)
{
_result = ParameterFinder.zFindOneForRelationship(_op);
}
return _result;
}
public void setParameter(Parameter parameter)
{
Parameter _parameter = (Parameter) parameter;
TransactionalBehavior _behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary();
UrlParameterData _data = (UrlParameterData) _behavior.getCurrentDataForWrite(this);
if (_behavior.isInMemory())
{
_data.setParameter(_parameter);
if (_parameter == null)
{
this.setParameterId(0);
}
else
{
this.setParameterId(_parameter.getId());
}
}
else if (_behavior.isPersisted())
{
_behavior.clearTempTransaction(this);
if (_parameter == null)
{
this.setParameterId(0);
}
else
{
this.setParameterId(
_parameter.getId());
}
}
else throw new RuntimeException("not implemented");
}
/**
* Relationship Expression:
(Url.serviceGroupName = this.serviceGroupName and Url.url = this.urlString )
* @see Url#getParameters() reverse relationship Url.getParameters()
* @return The url
*/
public Url getUrl()
{
Url _result = null;
Operation _op = null;
TransactionalBehavior _behavior = zGetTransactionalBehaviorForReadWithWaitIfNecessary();
UrlParameterData _data = (UrlParameterData) _behavior.getCurrentDataForRead(this);
MithraObjectPortal _portal = null;
if (_behavior.isPersisted())
{
{
_portal = UrlFinder.getMithraObjectPortal();
Object _related = _portal.getAsOneFromCache(this, _data, forurl, null, null);
if (!(_related instanceof NulledRelation)) _result = (Url) _related;
if (_related == null)
{
_op = new RelationshipMultiEqualityOperation(UrlParameterFinder.url().zGetRelationshipMultiExtractor(), this);
}
}
}
else if (_behavior.isDetached())
{
if (_data.getUrl() instanceof NulledRelation)
{
return null;
}
_result = (Url) _data.getUrl();
if (_result == null)
{
{
Operation detachedOp = new RelationshipMultiEqualityOperation(UrlParameterFinder.url().zGetRelationshipMultiExtractor(), this);
_result = UrlFinder.zFindOneForRelationship(detachedOp);
if(_result != null)
{
_result = _result.getDetachedCopy();
}
}
_data = (UrlParameterData) _behavior.getCurrentDataForWrite(this);
_data.setUrl(_result);
}
}
else if (_behavior.isInMemory())
{
_result = (Url) _data.getUrl();
if (_result == null)
{
{
_op = new RelationshipMultiEqualityOperation(UrlParameterFinder.url().zGetRelationshipMultiExtractor(), this);
}
}
}
if (_op != null)
{
_result = UrlFinder.zFindOneForRelationship(_op);
}
return _result;
}
public void setUrl(Url url)
{
Url _url = (Url) url;
TransactionalBehavior _behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary();
UrlParameterData _data = (UrlParameterData) _behavior.getCurrentDataForWrite(this);
if (_behavior.isInMemory())
{
Object _prev = _data.getUrl();
if (_behavior.isDetached() && _prev != null)
{
((DelegatingList)((Url)_prev).getParameters()).zMarkMoved( (UrlParameter) this);
}
_data.setUrl(_url);
_url.getParameters().add( (UrlParameter) this);
}
else if (_behavior.isPersisted())
{
_behavior.clearTempTransaction(this);
if (_url == null)
{
this.setServiceGroupName(null);
this.setUrlString(null);
}
else
{
this.setServiceGroupName(
_url.getServiceGroupName());
this.setUrlString(
_url.getUrl());
}
}
else throw new RuntimeException("not implemented");
}
public void zSetParentContainerurl(UrlAbstract parent)
{
TransactionalBehavior _behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary();
UrlParameterData _data = (UrlParameterData) _behavior.getCurrentDataForWrite(this);
_behavior.clearTempTransaction(this);
if (_behavior.isInMemory())
{
_data.setUrl(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 UrlParameter zCascadeCopyThenInsert() throws MithraBusinessException
{
TransactionalBehavior _behavior = zGetTransactionalBehaviorForWriteWithWaitIfNecessary();
UrlParameter original = (UrlParameter) _behavior.copyThenInsert(this);
return original;
}
protected void cascadeDeleteImpl() throws MithraBusinessException
{
this.delete();
}
public Cache zGetCache()
{
return UrlParameterFinder.getMithraObjectPortal().getCache();
}
public MithraObjectPortal zGetPortal()
{
return UrlParameterFinder.getMithraObjectPortal();
}
public UrlParameter getOriginalPersistentObject()
{
return this.zFindOriginal();
}
protected boolean issueUpdatesForNonPrimaryKeys(TransactionalBehavior behavior, MithraDataObject data, MithraDataObject newData)
{
boolean changed = false;
changed |= zUpdateInteger(behavior, data, newData, UrlParameterFinder.ordinal(), false);
changed |= zUpdateString(behavior, data, newData, UrlParameterFinder.type(), false);
return changed;
}
protected boolean issueUpdatesForPrimaryKeys(TransactionalBehavior behavior, MithraDataObject data, MithraDataObject newData)
{
boolean changed = false;
changed |= zUpdateLong(behavior, data, newData, UrlParameterFinder.parameterId(), false);
changed |= zUpdateString(behavior, data, newData, UrlParameterFinder.serviceGroupName(), false);
changed |= zUpdateString(behavior, data, newData, UrlParameterFinder.urlString(), false);
return changed;
}
public Object readResolve() throws ObjectStreamException
{
UrlParameterAbstract result = (UrlParameterAbstract) 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