All Downloads are FREE. Search and download functionalities are using the official Maven repository.

klass.model.meta.domain.ThisMemberReferencePathFinder 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.attribute.*;
import com.gs.fw.common.mithra.attribute.calculator.procedure.ObjectProcedure;
import com.gs.fw.common.mithra.behavior.txparticipation.*;
import com.gs.fw.common.mithra.cache.Cache;
import com.gs.fw.common.mithra.cache.bean.*;
import com.gs.fw.common.mithra.extractor.*;
import com.gs.fw.common.mithra.finder.*;
import com.gs.fw.common.mithra.finder.booleanop.*;
import com.gs.fw.common.mithra.finder.integer.*;
import com.gs.fw.common.mithra.finder.longop.*;
import com.gs.fw.common.mithra.finder.orderby.OrderBy;
import com.gs.fw.common.mithra.finder.string.*;
import com.gs.fw.common.mithra.extractor.NormalAndListValueSelector;
import com.gs.fw.common.mithra.list.NulledRelation;
import com.gs.fw.common.mithra.querycache.CachedQuery;
import com.gs.fw.common.mithra.querycache.QueryCache;
import com.gs.fw.common.mithra.portal.*;
import com.gs.fw.common.mithra.remote.*;
import com.gs.fw.common.mithra.transaction.MithraObjectPersister;
import com.gs.fw.common.mithra.util.TimestampPool;
import org.eclipse.collections.impl.map.mutable.UnifiedMap;
import java.io.Serializable;
/**
* This file was automatically generated using Mithra 18.0.0. Please do not modify it.
* Add custom logic to its subclass instead.
*/
public class ThisMemberReferencePathFinder
{
	private static final String IMPL_CLASS_NAME_WITH_SLASHES = "klass/model/meta/domain/ThisMemberReferencePath";
	private static final String BUSINESS_CLASS_NAME_WITH_DOTS = "klass.model.meta.domain.ThisMemberReferencePath";
	private static final FinderMethodMap finderMethodMap;
	private static boolean isFullCache;
	private static boolean isOffHeap;
	private static volatile MithraObjectPortal objectPortal = new UninitializedPortal("klass.model.meta.domain.ThisMemberReferencePath");
	private static final ThisMemberReferencePathSingleFinder finder = new ThisMemberReferencePathSingleFinder();
	private static ConstantStringSet[] constantStringSets = new ConstantStringSet[0];
	private static ConstantIntSet[] constantIntSets = new ConstantIntSet[0];
	private static ConstantShortSet[] constantShortSets = new ConstantShortSet[0];
	static
	{
		finderMethodMap = new FinderMethodMap(ThisMemberReferencePathFinder.ThisMemberReferencePathRelatedFinder.class);
		finderMethodMap.addNormalAttributeName("id");
		finderMethodMap.addRelationshipName("associationEndOrderBy");
		finderMethodMap.addRelationshipName("memberReferencePathSuperClass");
		finderMethodMap.addRelationshipName("serviceOrderBy");
	}

	public static Attribute[] allPersistentAttributes()
	{
		return finder.getPersistentAttributes();
	}

	public static List allRelatedFinders()
	{
		return finder.getRelationshipFinders();
	}

	public static List allDependentRelatedFinders()
	{
		return finder.getDependentRelationshipFinders();
	}

	public static ConstantStringSet zGetConstantStringSet(int index)
	{
		return constantStringSets[index];
	}

	public static ConstantIntSet zGetConstantIntSet(int index)
	{
		return constantIntSets[index];
	}

	public static ConstantShortSet zGetConstantShortSet(int index)
	{
		return constantShortSets[index];
	}

	public static SourceAttributeType getSourceAttributeType()
	{
		return null;
	}

	public static ThisMemberReferencePath findOne(com.gs.fw.finder.Operation operation)
	{
		return findOne(operation, false);
	}

	public static ThisMemberReferencePath findOneBypassCache(com.gs.fw.finder.Operation operation)
	{
		return findOne(operation, true);
	}

	public static ThisMemberReferencePathList findMany(com.gs.fw.finder.Operation operation)
	{
		return (ThisMemberReferencePathList) finder.findMany(operation);
	}

	public static ThisMemberReferencePathList findManyBypassCache(com.gs.fw.finder.Operation operation)
	{
		return (ThisMemberReferencePathList) finder.findManyBypassCache(operation);
	}

	private static ThisMemberReferencePath findOne(com.gs.fw.finder.Operation operation, boolean bypassCache)
	{
		List found = getMithraObjectPortal().find((Operation) operation, bypassCache);
		return (ThisMemberReferencePath) FinderUtils.findOne(found);
	}

	public static ThisMemberReferencePath findByPrimaryKey(long id)
	{
		return finder.findByPrimaryKey(id);
	}

	private static final RelationshipHashStrategy forPrimaryKey = new PrimaryKeyRhs();
	private static final class PrimaryKeyRhs implements RelationshipHashStrategy
	{
		public boolean equalsForRelationship(Object _srcObject, Object _srcData, Object _targetData, Timestamp _asOfDate0, Timestamp _asOfDate1)
		{
			I3O3L3 _bean = (I3O3L3) _srcData;
			ThisMemberReferencePathData _castedTargetData = (ThisMemberReferencePathData) _targetData;
			if (_bean.getL1AsLong() == _castedTargetData.getId())
			{
				return true;
			}

			return false;
		}

		public int computeHashCodeFromRelated(Object _srcObject, Object _srcData)
		{
			I3O3L3 _bean = (I3O3L3) _srcData;
			return HashUtil.hash(_bean.getL1AsLong());
		}

		public int computeOffHeapHashCodeFromRelated(Object _srcObject, Object _srcData)
		{
			I3O3L3 _bean = (I3O3L3) _srcData;
			return HashUtil.hash(_bean.getL1AsLong());
		}
	}

	public static ThisMemberReferencePath zFindOneForRelationship(Operation operation)
	{
		List found = getMithraObjectPortal().findAsCachedQuery(operation, null, false, true, 0).getResult();
		return (ThisMemberReferencePath) FinderUtils.findOne(found);
	}

	public static MithraObjectPortal getMithraObjectPortal()
	{
		return objectPortal.getInitializedPortal();
	}

	public static void clearQueryCache()
	{
		objectPortal.clearQueryCache();
	}

	public static void reloadCache()
	{
		objectPortal.reloadCache();
	}

	public static class ThisMemberReferencePathRelatedFinder extends AbstractRelatedFinder
	{
		private List relationshipFinders;
		private List dependentRelationshipFinders;
		private LongAttribute id;
		private ThisMemberReferencePathAssociationEndOrderByFinderSubclass associationEndOrderBy;
		private ThisMemberReferencePathMemberReferencePathSuperClassFinderSubclass memberReferencePathSuperClass;
		private ThisMemberReferencePathServiceOrderByFinderSubclass serviceOrderBy;
		public ThisMemberReferencePathRelatedFinder()
		{
			super();
		}

		public ThisMemberReferencePathRelatedFinder(Mapper mapper)
		{
			super(mapper);
		}

		public String getFinderClassName()
		{
			return "klass.model.meta.domain.ThisMemberReferencePathFinder";
		}

		public RelatedFinder getRelationshipFinderByName(String relationshipName)
		{
			return ThisMemberReferencePathFinder.finderMethodMap.getRelationshipFinderByName(relationshipName, this);
		}

		public Attribute getAttributeByName(String attributeName)
		{
			return ThisMemberReferencePathFinder.finderMethodMap.getAttributeByName(attributeName, this);
		}

		public com.gs.fw.common.mithra.extractor.Function getAttributeOrRelationshipSelector(String attributeName)
		{
			return ThisMemberReferencePathFinder.finderMethodMap.getAttributeOrRelationshipSelectorFunction(attributeName, this);
		}

		public Attribute[] getPersistentAttributes()
		{
			Attribute[] attributes = new Attribute[1];
			attributes[0] = this.id();
			return attributes;
		}

		public List getRelationshipFinders()
		{
			if (relationshipFinders == null)
			{
				List relatedFinders = new ArrayList(3);
				relatedFinders.add(this.associationEndOrderBy());
				relatedFinders.add(this.memberReferencePathSuperClass());
				relatedFinders.add(this.serviceOrderBy());
				relationshipFinders = Collections.unmodifiableList(relatedFinders);
			}

			return relationshipFinders;
		}

		public List getDependentRelationshipFinders()
		{
			if (dependentRelationshipFinders == null)
			{
				List dependentRelatedFinders = new ArrayList(0);
				dependentRelationshipFinders = Collections.unmodifiableList(dependentRelatedFinders);
			}

			return dependentRelationshipFinders;
		}

		public ThisMemberReferencePath findOne(com.gs.fw.finder.Operation operation)
		{
			return ThisMemberReferencePathFinder.findOne(operation, false);
		}

		public ThisMemberReferencePath findOneBypassCache(com.gs.fw.finder.Operation operation)
		{
			return ThisMemberReferencePathFinder.findOne(operation, true);
		}

		public MithraList findMany(com.gs.fw.finder.Operation operation)
		{
			return new ThisMemberReferencePathList((Operation) operation);
		}

		public MithraList findManyBypassCache(com.gs.fw.finder.Operation operation)
		{
			ThisMemberReferencePathList result = (ThisMemberReferencePathList) this.findMany(operation);
			result.setBypassCache(true);
			return result;
		}

		public MithraList constructEmptyList()
		{
			return new ThisMemberReferencePathList();
		}

		public int getSerialVersionId()
		{
			return -1472220267;
		}

		public boolean isPure()
		{
			return false;
		}

		public boolean isTemporary()
		{
			return false;
		}

		public int getHierarchyDepth()
		{
			return 0;
		}

		public LongAttribute id()
		{
			LongAttribute result = this.id;
			if (result == null)
			{
				result = mapper == null ? SingleColumnLongAttribute.generate("\"ID\"","","id",BUSINESS_CLASS_NAME_WITH_DOTS,IMPL_CLASS_NAME_WITH_SLASHES,false,false,this,null,true,false,false,-1,-1,-1,false, false) :
					new MappedLongAttribute(ThisMemberReferencePathFinder.id(), this.mapper, this.zGetValueSelector());
				result.zSetOwningRelationship("memberReferencePathSuperClass");
				result.zSetOwningReverseRelationship("klass.model.meta.domain", "MemberReferencePath", "thisMemberReferencePathSubClass");
				this.id = result;
			}

			return result;
		}

		public AssociationEndOrderByFinder.AssociationEndOrderBySingleFinderForRelatedClasses associationEndOrderBy()
		{
			ThisMemberReferencePathAssociationEndOrderByFinderSubclass result = this.associationEndOrderBy;
			if (result == null)
			{
				Mapper newMapper = combineWithMapperIfExists(AssociationEndOrderByFinder.zGetAssociationEndOrderByThisMemberReferencePathMapper());
				newMapper.setToMany(false);
				result = new ThisMemberReferencePathAssociationEndOrderByFinderSubclass(newMapper , this.zGetValueSelector() );
				this.associationEndOrderBy = result;
			}

			return result;
		}

		public MemberReferencePathFinder.MemberReferencePathSingleFinderForRelatedClasses memberReferencePathSuperClass()
		{
			ThisMemberReferencePathMemberReferencePathSuperClassFinderSubclass result = this.memberReferencePathSuperClass;
			if (result == null)
			{
				Mapper newMapper = combineWithMapperIfExists(MemberReferencePathFinder.zGetMemberReferencePathThisMemberReferencePathSubClassMapper());
				newMapper.setToMany(false);
				result = new ThisMemberReferencePathMemberReferencePathSuperClassFinderSubclass(newMapper , this.zGetValueSelector() );
				this.memberReferencePathSuperClass = result;
			}

			return result;
		}

		public ServiceOrderByFinder.ServiceOrderBySingleFinderForRelatedClasses serviceOrderBy()
		{
			ThisMemberReferencePathServiceOrderByFinderSubclass result = this.serviceOrderBy;
			if (result == null)
			{
				Mapper newMapper = combineWithMapperIfExists(ServiceOrderByFinder.zGetServiceOrderByThisMemberReferencePathMapper());
				newMapper.setToMany(false);
				result = new ThisMemberReferencePathServiceOrderByFinderSubclass(newMapper , this.zGetValueSelector() );
				this.serviceOrderBy = result;
			}

			return result;
		}

		public Attribute getSourceAttribute()
		{
			return null;
		}

		private Mapper combineWithMapperIfExists(Mapper newMapper)
		{
			if (this.mapper != null)
			{
				return new LinkedMapper(this.mapper, newMapper);
			}

			return newMapper;
		}

		public Attribute[] getPrimaryKeyAttributes()
		{
			return ThisMemberReferencePathFinder.getPrimaryKeyAttributes();
		}

		public VersionAttribute getVersionAttribute()
		{
			return null;
		}

		public MithraObjectPortal getMithraObjectPortal()
		{
			return ThisMemberReferencePathFinder.getMithraObjectPortal();
		}
	}

	public static class ThisMemberReferencePathCollectionFinder extends ThisMemberReferencePathRelatedFinder
	{
		public ThisMemberReferencePathCollectionFinder(Mapper mapper)
		{
			super(mapper);
		}
	}

	public static abstract class ThisMemberReferencePathCollectionFinderForRelatedClasses
	extends ThisMemberReferencePathCollectionFinder
	implements DeepRelationshipAttribute
	{
		public ThisMemberReferencePathCollectionFinderForRelatedClasses(Mapper mapper)
		{
			super(mapper);
		}

		protected NormalAndListValueSelector zGetValueSelector()
		{
			return this;
		}
	}

	public static class ThisMemberReferencePathSingleFinder extends ThisMemberReferencePathRelatedFinder
	implements ToOneFinder
	{
		public ThisMemberReferencePathSingleFinder(Mapper mapper)
		{
			super(mapper);
		}

		public ThisMemberReferencePathSingleFinder()
		{
			super(null);
		}

		public Operation eq(ThisMemberReferencePath other)
		{
			return this.id().eq(other.getId())
			;
		}
		// this implementation uses private API. Do NOT copy to application code. Application code must use normal operations for lookups.
		public ThisMemberReferencePath findByPrimaryKey(long id)
		{
			ThisMemberReferencePath _result = null;
			Operation _op = null;
			Object _related = null;
			{
				I3O3L3 _bean = I3O3L3.POOL.getOrConstruct();
				_bean.setL1AsLong(id);
				MithraObjectPortal _portal = this.getMithraObjectPortal();
				_related = _portal.getAsOneFromCacheForFind(_bean, _bean, forPrimaryKey, null, null);
				_bean.release();
			}

			if (!(_related instanceof NulledRelation)) _result = (ThisMemberReferencePath) _related;
			if (_related == null)
			{
				_op = this.id().eq(id);
			}

			if (_op != null)
			{
				_result = this.findOne(_op);
			}

			return _result;
		}
	}

	public static abstract class ThisMemberReferencePathSingleFinderForRelatedClasses extends ThisMemberReferencePathSingleFinder implements DeepRelationshipAttribute
	{
		public ThisMemberReferencePathSingleFinderForRelatedClasses(Mapper mapper)
		{
			super(mapper);
		}

		protected NormalAndListValueSelector zGetValueSelector()
		{
			return this;
		}
	}

	/** maps to \"THIS_MEMBER_REFERENCE_PATH\".\"ID\" **/
	public static LongAttribute id()
	{
		return finder.id();
	}

	public static AssociationEndOrderByFinder.AssociationEndOrderBySingleFinderForRelatedClasses associationEndOrderBy()
	{
		return finder.associationEndOrderBy();
	}

	public static class ThisMemberReferencePathAssociationEndOrderByFinderSubclass extends AssociationEndOrderByFinder.AssociationEndOrderBySingleFinderForRelatedClasses
	{
		public ThisMemberReferencePathAssociationEndOrderByFinderSubclass(Mapper mapper, NormalAndListValueSelector parentSelector )
		{
			super(mapper);
			this._parentSelector = (AbstractRelatedFinder) parentSelector;
			this._orderBy = null;
			this._type = SIMPLE_TO_ONE;
			this._name = "associationEndOrderBy";
		}

		public DeepRelationshipAttribute copy()
		{
			return new ThisMemberReferencePathAssociationEndOrderByFinderSubclass(zGetMapper(), (NormalAndListValueSelector) this._parentSelector
			);
		}

		protected AssociationEndOrderBy plainValueOf(ThisMemberReferencePath _obj)
		{
			return _obj.getAssociationEndOrderBy();
		}

		protected AssociationEndOrderByList plainListValueOf(Object _obj)
		{
			return ((ThisMemberReferencePathList)_obj).getAssociationEndOrderBies();
		}
	}

	public static MemberReferencePathFinder.MemberReferencePathSingleFinderForRelatedClasses memberReferencePathSuperClass()
	{
		return finder.memberReferencePathSuperClass();
	}

	public static class ThisMemberReferencePathMemberReferencePathSuperClassFinderSubclass extends MemberReferencePathFinder.MemberReferencePathSingleFinderForRelatedClasses
	{
		public ThisMemberReferencePathMemberReferencePathSuperClassFinderSubclass(Mapper mapper, NormalAndListValueSelector parentSelector )
		{
			super(mapper);
			this._parentSelector = (AbstractRelatedFinder) parentSelector;
			this._orderBy = null;
			this._type = SIMPLE_TO_ONE;
			this._name = "memberReferencePathSuperClass";
		}

		public DeepRelationshipAttribute copy()
		{
			return new ThisMemberReferencePathMemberReferencePathSuperClassFinderSubclass(zGetMapper(), (NormalAndListValueSelector) this._parentSelector
			);
		}

		protected MemberReferencePath plainValueOf(ThisMemberReferencePath _obj)
		{
			return _obj.getMemberReferencePathSuperClass();
		}

		protected MemberReferencePathList plainListValueOf(Object _obj)
		{
			return ((ThisMemberReferencePathList)_obj).getMemberReferencePathSuperClass();
		}
	}

	public static ServiceOrderByFinder.ServiceOrderBySingleFinderForRelatedClasses serviceOrderBy()
	{
		return finder.serviceOrderBy();
	}

	public static class ThisMemberReferencePathServiceOrderByFinderSubclass extends ServiceOrderByFinder.ServiceOrderBySingleFinderForRelatedClasses
	{
		public ThisMemberReferencePathServiceOrderByFinderSubclass(Mapper mapper, NormalAndListValueSelector parentSelector )
		{
			super(mapper);
			this._parentSelector = (AbstractRelatedFinder) parentSelector;
			this._orderBy = null;
			this._type = SIMPLE_TO_ONE;
			this._name = "serviceOrderBy";
		}

		public DeepRelationshipAttribute copy()
		{
			return new ThisMemberReferencePathServiceOrderByFinderSubclass(zGetMapper(), (NormalAndListValueSelector) this._parentSelector
			);
		}

		protected ServiceOrderBy plainValueOf(ThisMemberReferencePath _obj)
		{
			return _obj.getServiceOrderBy();
		}

		protected ServiceOrderByList plainListValueOf(Object _obj)
		{
			return ((ThisMemberReferencePathList)_obj).getServiceOrderBies();
		}
	}

	public static Operation eq(ThisMemberReferencePath other)
	{
		return finder.eq(other);
	}

	public static Operation all()
	{
		return new All(id());
	}

	public static ThisMemberReferencePathSingleFinder getFinderInstance()
	{
		return finder;
	}

	public static Attribute[] getPrimaryKeyAttributes()
	{
		return new Attribute[] 
		{
			id()
		}

		;
	}

	public static Attribute[] getImmutableAttributes()
	{
		return new Attribute[] 
		{
			id()
			, id()
		}

		;
	}

	public static AsOfAttribute[] getAsOfAttributes()
	{
		return null;
	}

	protected static void initializeIndicies(Cache cache)
	{
	}

	protected static void initializePortal(MithraObjectDeserializer objectFactory, Cache cache,
		MithraConfigurationManager.Config config)
	{
		initializeIndicies(cache);
		isFullCache = cache.isFullCache();
		isOffHeap = cache.isOffHeap();
		MithraObjectPortal portal;
		if (config.isParticipatingInTx())
		{
			portal = new MithraTransactionalPortal(objectFactory, cache, getFinderInstance(),
				config.getRelationshipCacheSize(), config.getMinQueriesToKeep(), null,
				null, null, 0,
				(MithraObjectPersister) objectFactory);
		}
		else
		{
			portal = new MithraReadOnlyPortal(objectFactory, cache, getFinderInstance(),
				config.getRelationshipCacheSize(), config.getMinQueriesToKeep(), null,
				null, null, 0,
				(MithraObjectPersister) objectFactory);
		}

		portal.setParentFinders(new RelatedFinder[] 
		{
			AssociationEndOrderByFinder.getFinderInstance(),MemberReferencePathFinder.getFinderInstance(),ServiceOrderByFinder.getFinderInstance(),
		}

		);
		config.initializePortal(portal);
		objectPortal.destroy();
		objectPortal = portal;
	}

	protected static void initializeClientPortal(MithraObjectDeserializer objectFactory, Cache cache,
		MithraConfigurationManager.Config config)
	{
		initializeIndicies(cache);
		isFullCache = cache.isFullCache();
		isOffHeap = cache.isOffHeap();
		MithraObjectPortal portal;
		if (config.isParticipatingInTx())
		{
			portal = new MithraTransactionalPortal(objectFactory, cache, getFinderInstance(),
				config.getRelationshipCacheSize(), config.getMinQueriesToKeep(),
				null, null,
				null, 0,
				new RemoteMithraObjectPersister(config.getRemoteMithraService(), getFinderInstance(), false));
		}
		else
		{
			portal = new MithraReadOnlyPortal(objectFactory, cache, getFinderInstance(),
				config.getRelationshipCacheSize(), config.getMinQueriesToKeep(),
				null, null,
				null, 0,
				new RemoteMithraObjectPersister(config.getRemoteMithraService(), getFinderInstance(), false));
		}

		portal.setParentFinders(new RelatedFinder[] 
		{
			AssociationEndOrderByFinder.getFinderInstance(),MemberReferencePathFinder.getFinderInstance(),ServiceOrderByFinder.getFinderInstance(),
		}

		);
		config.initializePortal(portal);
		objectPortal.destroy();
		objectPortal = portal;
	}

	public static boolean isFullCache()
	{
		return isFullCache;
	}

	public static boolean isOffHeap()
	{
		return isOffHeap;
	}

	public static Attribute getAttributeByName(String attributeName)
	{
		return finder.getAttributeByName(attributeName);
	}

	public static com.gs.fw.common.mithra.extractor.Function getAttributeOrRelationshipSelector(String attributeName)
	{
		return finder.getAttributeOrRelationshipSelector(attributeName);
	}

	public static RelatedFinder getRelatedFinderByName(String relationshipName)
	{
		return finder.getRelationshipFinderByName(relationshipName);
	}

	public static DoubleAttribute[] zGetDoubleAttributes()
	{
		DoubleAttribute[] result = new DoubleAttribute[0];
		return result;
	}

	public static BigDecimalAttribute[] zGetBigDecimalAttributes()
	{
		BigDecimalAttribute[] result = new BigDecimalAttribute[0];
		return result;
	}

	public static void zResetPortal()
	{
		objectPortal.destroy();
		objectPortal = new UninitializedPortal("klass.model.meta.domain.ThisMemberReferencePath");
		isFullCache = false;
		isOffHeap = false;
	}

	public static void setTransactionModeFullTransactionParticipation(MithraTransaction tx)
	{
		tx.setTxParticipationMode(objectPortal, FullTransactionalParticipationMode.getInstance());
	}

	public static void setTransactionModeReadCacheUpdateCausesRefreshAndLock(MithraTransaction tx)
	{
		tx.setTxParticipationMode(objectPortal, ReadCacheUpdateCausesRefreshAndLockTxParticipationMode.getInstance());
	}

	public static void registerForNotification(MithraApplicationClassLevelNotificationListener listener)
	{
		getMithraObjectPortal().registerForApplicationClassLevelNotification(listener);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy