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

klass.model.meta.domain.AssociationEndFinder 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 AssociationEndFinder
{
	private static final String IMPL_CLASS_NAME_WITH_SLASHES = "klass/model/meta/domain/AssociationEnd";
	private static final String BUSINESS_CLASS_NAME_WITH_DOTS = "klass.model.meta.domain.AssociationEnd";
	private static final FinderMethodMap finderMethodMap;
	private static boolean isFullCache;
	private static boolean isOffHeap;
	private static volatile MithraObjectPortal objectPortal = new UninitializedPortal("klass.model.meta.domain.AssociationEnd");
	private static final AssociationEndSingleFinder finder = new AssociationEndSingleFinder();
	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(AssociationEndFinder.AssociationEndRelatedFinder.class);
		finderMethodMap.addNormalAttributeName("owningClassName");
		finderMethodMap.addNormalAttributeName("name");
		finderMethodMap.addNormalAttributeName("associationName");
		finderMethodMap.addNormalAttributeName("resultTypeName");
		finderMethodMap.addNormalAttributeName("ordinal");
		finderMethodMap.addNormalAttributeName("direction");
		finderMethodMap.addNormalAttributeName("multiplicity");
		finderMethodMap.addRelationshipName("resultType");
		finderMethodMap.addRelationshipName("associationEndModifiers");
		finderMethodMap.addRelationshipName("orderBys");
		finderMethodMap.addRelationshipName("owningAssociation");
		finderMethodMap.addRelationshipName("owningClass");
		finderMethodMap.addRelationshipName("memberReferencePaths");
		finderMethodMap.addRelationshipName("projectionsWithAssociationEnd");
	}

	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 Mapper zGetConstantJoin(int index)
	{
		return getConstantJoinPool()[index];
	}

	private static Mapper[] constantJoinPool;
	private static Mapper[] getConstantJoinPool()
	{
		if (constantJoinPool == null)
		{
			Mapper[] result = new Mapper[10];
			result[0] = AssociationEndFinder.resultTypeName().constructEqualityMapper(KlassFinder.name());
			result[1] = KlassFinder.name().constructEqualityMapper(AssociationEndFinder.resultTypeName());
			result[2] = AssociationEndFinder.owningClassName().constructEqualityMapper(AssociationEndModifierFinder.owningClassName());
			result[3] = AssociationEndModifierFinder.owningClassName().constructEqualityMapper(AssociationEndFinder.owningClassName());
			result[4] = AssociationEndFinder.name().constructEqualityMapper(AssociationEndModifierFinder.associationEndName());
			result[5] = AssociationEndModifierFinder.associationEndName().constructEqualityMapper(AssociationEndFinder.name());
			result[6] = AssociationEndFinder.owningClassName().constructEqualityMapper(AssociationEndOrderByFinder.associationEndClassName());
			result[7] = AssociationEndOrderByFinder.associationEndClassName().constructEqualityMapper(AssociationEndFinder.owningClassName());
			result[8] = AssociationEndFinder.name().constructEqualityMapper(AssociationEndOrderByFinder.associationEndName());
			result[9] = AssociationEndOrderByFinder.associationEndName().constructEqualityMapper(AssociationEndFinder.name());
			constantJoinPool = result;
		}

		return constantJoinPool;
	}

	public static SourceAttributeType getSourceAttributeType()
	{
		return null;
	}

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

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

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

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

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

	public static AssociationEnd findByPrimaryKey(String owningClassName, String name)
	{
		return finder.findByPrimaryKey(owningClassName, name);
	}

	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;
			AssociationEndData _castedTargetData = (AssociationEndData) _targetData;
			if (_bean.getO1AsString().equals(_castedTargetData.getOwningClassName()) && _bean.getO2AsString().equals(_castedTargetData.getName()))
			{
				return true;
			}

			return false;
		}

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

		public int computeOffHeapHashCodeFromRelated(Object _srcObject, Object _srcData)
		{
			I3O3L3 _bean = (I3O3L3) _srcData;
			return HashUtil.combineHashes(HashUtil.offHeapHash(_bean.getO1AsString()),HashUtil.offHeapHash(_bean.getO2AsString()));
		}
	}

	public static AssociationEnd zFindOneForRelationship(Operation operation)
	{
		List found = getMithraObjectPortal().findAsCachedQuery(operation, null, false, true, 0).getResult();
		return (AssociationEnd) 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 AssociationEndRelatedFinder extends AbstractRelatedFinder
	implements NamedElementFinder
	{
		private List relationshipFinders;
		private List dependentRelationshipFinders;
		private StringAttribute owningClassName;
		private StringAttribute name;
		private StringAttribute associationName;
		private StringAttribute resultTypeName;
		private IntegerAttribute ordinal;
		private StringAttribute direction;
		private StringAttribute multiplicity;
		private AssociationEndResultTypeFinderSubclass resultType;
		private AssociationEndAssociationEndModifiersFinderSubclass associationEndModifiers;
		private AssociationEndOrderBysFinderSubclass orderBys;
		private AssociationEndOwningAssociationFinderSubclass owningAssociation;
		private AssociationEndOwningClassFinderSubclass owningClass;
		private AssociationEndMemberReferencePathsFinderSubclass memberReferencePaths;
		private AssociationEndProjectionsWithAssociationEndFinderSubclass projectionsWithAssociationEnd;
		public AssociationEndRelatedFinder()
		{
			super();
		}

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

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

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

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

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

		public Attribute[] getPersistentAttributes()
		{
			Attribute[] attributes = new Attribute[7];
			attributes[0] = this.owningClassName();
			attributes[1] = this.name();
			attributes[2] = this.associationName();
			attributes[3] = this.resultTypeName();
			attributes[4] = this.ordinal();
			attributes[5] = this.direction();
			attributes[6] = this.multiplicity();
			return attributes;
		}

		public List getRelationshipFinders()
		{
			if (relationshipFinders == null)
			{
				List relatedFinders = new ArrayList(7);
				relatedFinders.add(this.resultType());
				relatedFinders.add(this.associationEndModifiers());
				relatedFinders.add(this.orderBys());
				relatedFinders.add(this.owningAssociation());
				relatedFinders.add(this.owningClass());
				relatedFinders.add(this.memberReferencePaths());
				relatedFinders.add(this.projectionsWithAssociationEnd());
				relationshipFinders = Collections.unmodifiableList(relatedFinders);
			}

			return relationshipFinders;
		}

		public List getDependentRelationshipFinders()
		{
			if (dependentRelationshipFinders == null)
			{
				List dependentRelatedFinders = new ArrayList(2);
				dependentRelatedFinders.add(this.associationEndModifiers());
				dependentRelatedFinders.add(this.orderBys());
				dependentRelationshipFinders = Collections.unmodifiableList(dependentRelatedFinders);
			}

			return dependentRelationshipFinders;
		}

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

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

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

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

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

		public int getSerialVersionId()
		{
			return -1522837230;
		}

		public boolean isPure()
		{
			return false;
		}

		public boolean isTemporary()
		{
			return false;
		}

		public int getHierarchyDepth()
		{
			return 0;
		}

		public StringAttribute owningClassName()
		{
			StringAttribute result = this.owningClassName;
			if (result == null)
			{
				result = mapper == null ? SingleColumnStringAttribute.generate("\"OWNING_CLASS_NAME\"","","owningClassName",BUSINESS_CLASS_NAME_WITH_DOTS,IMPL_CLASS_NAME_WITH_SLASHES,false,false,this,null,true,false,-1,-1,-1,256,false, false) :
					new MappedStringAttribute(AssociationEndFinder.owningClassName(), this.mapper, this.zGetValueSelector());
				result.zSetOwningRelationship("owningClass");
				result.zSetOwningReverseRelationship("klass.model.meta.domain", "Klass", "associationEnds");
				this.owningClassName = result;
			}

			return result;
		}

		public StringAttribute name()
		{
			StringAttribute result = this.name;
			if (result == null)
			{
				result = mapper == null ? SingleColumnStringAttribute.generate("\"NAME\"","","name",BUSINESS_CLASS_NAME_WITH_DOTS,IMPL_CLASS_NAME_WITH_SLASHES,false,false,this,null,true,false,-1,-1,-1,256,false, false) :
					new MappedStringAttribute(AssociationEndFinder.name(), this.mapper, this.zGetValueSelector());
				this.name = result;
			}

			return result;
		}

		public StringAttribute associationName()
		{
			StringAttribute result = this.associationName;
			if (result == null)
			{
				result = mapper == null ? SingleColumnStringAttribute.generate("\"ASSOCIATION_NAME\"","","associationName",BUSINESS_CLASS_NAME_WITH_DOTS,IMPL_CLASS_NAME_WITH_SLASHES,false,false,this,null,true,false,-1,-1,-1,256,false, false) :
					new MappedStringAttribute(AssociationEndFinder.associationName(), this.mapper, this.zGetValueSelector());
				result.zSetOwningRelationship("owningAssociation");
				result.zSetOwningReverseRelationship("klass.model.meta.domain", "Association", "associationEnds");
				this.associationName = result;
			}

			return result;
		}

		public StringAttribute resultTypeName()
		{
			StringAttribute result = this.resultTypeName;
			if (result == null)
			{
				result = mapper == null ? SingleColumnStringAttribute.generate("\"RESULT_TYPE_NAME\"","","resultTypeName",BUSINESS_CLASS_NAME_WITH_DOTS,IMPL_CLASS_NAME_WITH_SLASHES,false,false,this,null,true,false,-1,-1,-1,256,false, false) :
					new MappedStringAttribute(AssociationEndFinder.resultTypeName(), this.mapper, this.zGetValueSelector());
				result.zSetOwningRelationship("resultType");
				result.zSetOwningReverseRelationship("klass.model.meta.domain", "Klass", "associationEndsResultTypeOf");
				this.resultTypeName = result;
			}

			return result;
		}

		public IntegerAttribute ordinal()
		{
			IntegerAttribute result = this.ordinal;
			if (result == null)
			{
				result = mapper == null ? SingleColumnIntegerAttribute.generate("\"ORDINAL\"","","ordinal",BUSINESS_CLASS_NAME_WITH_DOTS,IMPL_CLASS_NAME_WITH_SLASHES,false,false,this,null,true,false,false,-1,-1,-1,false, false) :
					new MappedIntegerAttribute(AssociationEndFinder.ordinal(), this.mapper, this.zGetValueSelector());
				this.ordinal = result;
			}

			return result;
		}

		public StringAttribute direction()
		{
			StringAttribute result = this.direction;
			if (result == null)
			{
				result = mapper == null ? SingleColumnStringAttribute.generate("\"DIRECTION\"","","direction",BUSINESS_CLASS_NAME_WITH_DOTS,IMPL_CLASS_NAME_WITH_SLASHES,false,false,this,null,true,false,-1,-1,-1,256,false, false) :
					new MappedStringAttribute(AssociationEndFinder.direction(), this.mapper, this.zGetValueSelector());
				this.direction = result;
			}

			return result;
		}

		public StringAttribute multiplicity()
		{
			StringAttribute result = this.multiplicity;
			if (result == null)
			{
				result = mapper == null ? SingleColumnStringAttribute.generate("\"MULTIPLICITY\"","","multiplicity",BUSINESS_CLASS_NAME_WITH_DOTS,IMPL_CLASS_NAME_WITH_SLASHES,false,false,this,null,true,false,-1,-1,-1,256,false, false) :
					new MappedStringAttribute(AssociationEndFinder.multiplicity(), this.mapper, this.zGetValueSelector());
				this.multiplicity = result;
			}

			return result;
		}

		public KlassFinder.KlassSingleFinderForRelatedClasses resultType()
		{
			AssociationEndResultTypeFinderSubclass result = this.resultType;
			if (result == null)
			{
				Mapper newMapper = combineWithMapperIfExists(AssociationEndFinder.zGetAssociationEndResultTypeReverseMapper());
				newMapper.setToMany(false);
				result = new AssociationEndResultTypeFinderSubclass(newMapper , this.zGetValueSelector() );
				this.resultType = result;
			}

			return result;
		}

		public AssociationEndModifierFinder.AssociationEndModifierCollectionFinderForRelatedClasses associationEndModifiers()
		{
			AssociationEndAssociationEndModifiersFinderSubclass result = this.associationEndModifiers;
			if (result == null)
			{
				Mapper newMapper = combineWithMapperIfExists(AssociationEndFinder.zGetAssociationEndAssociationEndModifiersReverseMapper());
				newMapper.setToMany(true);
				result = new AssociationEndAssociationEndModifiersFinderSubclass(newMapper , this.zGetValueSelector() );
				this.associationEndModifiers = result;
			}

			return result;
		}

		public AssociationEndOrderByFinder.AssociationEndOrderByCollectionFinderForRelatedClasses orderBys()
		{
			AssociationEndOrderBysFinderSubclass result = this.orderBys;
			if (result == null)
			{
				Mapper newMapper = combineWithMapperIfExists(AssociationEndFinder.zGetAssociationEndOrderBysReverseMapper());
				newMapper.setToMany(true);
				result = new AssociationEndOrderBysFinderSubclass(newMapper , this.zGetValueSelector() );
				this.orderBys = result;
			}

			return result;
		}

		public AssociationFinder.AssociationSingleFinderForRelatedClasses owningAssociation()
		{
			AssociationEndOwningAssociationFinderSubclass result = this.owningAssociation;
			if (result == null)
			{
				Mapper newMapper = combineWithMapperIfExists(AssociationFinder.zGetAssociationAssociationEndsMapper());
				newMapper.setToMany(false);
				result = new AssociationEndOwningAssociationFinderSubclass(newMapper , this.zGetValueSelector() );
				this.owningAssociation = result;
			}

			return result;
		}

		public KlassFinder.KlassSingleFinderForRelatedClasses owningClass()
		{
			AssociationEndOwningClassFinderSubclass result = this.owningClass;
			if (result == null)
			{
				Mapper newMapper = combineWithMapperIfExists(KlassFinder.zGetKlassAssociationEndsMapper());
				newMapper.setToMany(false);
				result = new AssociationEndOwningClassFinderSubclass(newMapper , this.zGetValueSelector() );
				this.owningClass = result;
			}

			return result;
		}

		public MemberReferencePathAssociationEndMappingFinder.MemberReferencePathAssociationEndMappingCollectionFinderForRelatedClasses memberReferencePaths()
		{
			AssociationEndMemberReferencePathsFinderSubclass result = this.memberReferencePaths;
			if (result == null)
			{
				Mapper newMapper = combineWithMapperIfExists(MemberReferencePathAssociationEndMappingFinder.zGetMemberReferencePathAssociationEndMappingAssociationEndMapper());
				newMapper.setToMany(true);
				result = new AssociationEndMemberReferencePathsFinderSubclass(newMapper , this.zGetValueSelector() );
				this.memberReferencePaths = result;
			}

			return result;
		}

		public ProjectionWithAssociationEndFinder.ProjectionWithAssociationEndCollectionFinderForRelatedClasses projectionsWithAssociationEnd()
		{
			AssociationEndProjectionsWithAssociationEndFinderSubclass result = this.projectionsWithAssociationEnd;
			if (result == null)
			{
				Mapper newMapper = combineWithMapperIfExists(ProjectionWithAssociationEndFinder.zGetProjectionWithAssociationEndAssociationEndMapper());
				newMapper.setToMany(true);
				result = new AssociationEndProjectionsWithAssociationEndFinderSubclass(newMapper , this.zGetValueSelector() );
				this.projectionsWithAssociationEnd = 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 AssociationEndFinder.getPrimaryKeyAttributes();
		}

		public VersionAttribute getVersionAttribute()
		{
			return null;
		}

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

	public static class AssociationEndCollectionFinder extends AssociationEndRelatedFinder
	{
		public AssociationEndCollectionFinder(Mapper mapper)
		{
			super(mapper);
		}
	}

	public static abstract class AssociationEndCollectionFinderForRelatedClasses
	extends AssociationEndCollectionFinder
	implements DeepRelationshipAttribute
	{
		public AssociationEndCollectionFinderForRelatedClasses(Mapper mapper)
		{
			super(mapper);
		}

		protected NormalAndListValueSelector zGetValueSelector()
		{
			return this;
		}
	}

	public static class AssociationEndSingleFinder extends AssociationEndRelatedFinder
	implements ToOneFinder
	{
		public AssociationEndSingleFinder(Mapper mapper)
		{
			super(mapper);
		}

		public AssociationEndSingleFinder()
		{
			super(null);
		}

		public Operation eq(AssociationEnd other)
		{
			return this.owningClassName().eq(other.getOwningClassName())
			.and(this.name().eq(other.getName()))
			;
		}
		// this implementation uses private API. Do NOT copy to application code. Application code must use normal operations for lookups.
		public AssociationEnd findByPrimaryKey(String owningClassName, String name)
		{
			AssociationEnd _result = null;
			Operation _op = null;
			Object _related = null;
			if (owningClassName != null && name != null)
			{
				I3O3L3 _bean = I3O3L3.POOL.getOrConstruct();
				_bean.setO1(owningClassName);
				_bean.setO2(name);
				MithraObjectPortal _portal = this.getMithraObjectPortal();
				_related = _portal.getAsOneFromCacheForFind(_bean, _bean, forPrimaryKey, null, null);
				_bean.release();
			}

			if (!(_related instanceof NulledRelation)) _result = (AssociationEnd) _related;
			if (_related == null)
			{
				_op = this.owningClassName().eq(owningClassName).and(this.name().eq(name));
			}

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

			return _result;
		}
	}

	public static abstract class AssociationEndSingleFinderForRelatedClasses extends AssociationEndSingleFinder implements DeepRelationshipAttribute
	{
		public AssociationEndSingleFinderForRelatedClasses(Mapper mapper)
		{
			super(mapper);
		}

		protected NormalAndListValueSelector zGetValueSelector()
		{
			return this;
		}
	}

	private static Mapper resultTypeReverseMapper = null;
	public static Mapper zGetAssociationEndResultTypeReverseMapper()
	{
		if (resultTypeReverseMapper == null)
		{
			resultTypeReverseMapper = zConstructAssociationEndResultTypeReverseMapper();
		}

		return resultTypeReverseMapper;
	}

	private static Mapper resultTypeMapper = null;
	public static Mapper zGetAssociationEndResultTypeMapper()
	{
		if (resultTypeMapper == null)
		{
			resultTypeMapper = zConstructAssociationEndResultTypeMapper();
		}

		return resultTypeMapper;
	}

	private static Mapper resultTypePureReverseMapper = null;
	public static Mapper zGetAssociationEndResultTypePureReverseMapper()
	{
		if (resultTypePureReverseMapper == null)
		{
			resultTypePureReverseMapper = zConstructAssociationEndResultTypePureReverseMapper();
		}

		return resultTypePureReverseMapper;
	}

	private static Mapper zConstructAssociationEndResultTypePureReverseMapper()
	{
		Mapper resultTypeMapper = AssociationEndFinder.zGetConstantJoin(0);
		resultTypeMapper.setName("resultType");
		return resultTypeMapper;
	}

	private static Mapper zConstructAssociationEndResultTypeReverseMapper()
	{
		Mapper resultTypeMapper = AssociationEndFinder.zGetConstantJoin(0);
		resultTypeMapper.setName("resultType");
		return resultTypeMapper;
	}

	private static Mapper zConstructAssociationEndResultTypeMapper()
	{
		Mapper resultTypeMapper = AssociationEndFinder.zGetConstantJoin(1);
		resultTypeMapper.setName("associationEndsResultTypeOf");
		return resultTypeMapper;
	}

	private static Mapper associationEndModifiersReverseMapper = null;
	public static Mapper zGetAssociationEndAssociationEndModifiersReverseMapper()
	{
		if (associationEndModifiersReverseMapper == null)
		{
			associationEndModifiersReverseMapper = zConstructAssociationEndAssociationEndModifiersReverseMapper();
		}

		return associationEndModifiersReverseMapper;
	}

	private static Mapper associationEndModifiersMapper = null;
	public static Mapper zGetAssociationEndAssociationEndModifiersMapper()
	{
		if (associationEndModifiersMapper == null)
		{
			associationEndModifiersMapper = zConstructAssociationEndAssociationEndModifiersMapper();
		}

		return associationEndModifiersMapper;
	}

	private static Mapper associationEndModifiersPureReverseMapper = null;
	public static Mapper zGetAssociationEndAssociationEndModifiersPureReverseMapper()
	{
		if (associationEndModifiersPureReverseMapper == null)
		{
			associationEndModifiersPureReverseMapper = zConstructAssociationEndAssociationEndModifiersPureReverseMapper();
		}

		return associationEndModifiersPureReverseMapper;
	}

	private static Mapper zConstructAssociationEndAssociationEndModifiersPureReverseMapper()
	{
		InternalList associationEndModifiersMapperMapperList = new InternalList(2);
		associationEndModifiersMapperMapperList.add(AssociationEndFinder.zGetConstantJoin(2));
		associationEndModifiersMapperMapperList.add(AssociationEndFinder.zGetConstantJoin(4));
		Mapper associationEndModifiersMapper = new MultiEqualityMapper(associationEndModifiersMapperMapperList);
		associationEndModifiersMapper.setName("associationEndModifiers");
		return associationEndModifiersMapper;
	}

	private static Mapper zConstructAssociationEndAssociationEndModifiersReverseMapper()
	{
		InternalList associationEndModifiersMapperMapperList = new InternalList(2);
		associationEndModifiersMapperMapperList.add(AssociationEndFinder.zGetConstantJoin(2));
		associationEndModifiersMapperMapperList.add(AssociationEndFinder.zGetConstantJoin(4));
		Mapper associationEndModifiersMapper = new MultiEqualityMapper(associationEndModifiersMapperMapperList);
		associationEndModifiersMapper.setName("associationEndModifiers");
		return associationEndModifiersMapper;
	}

	private static Mapper zConstructAssociationEndAssociationEndModifiersMapper()
	{
		InternalList associationEndModifiersMapperMapperList = new InternalList(2);
		associationEndModifiersMapperMapperList.add(AssociationEndFinder.zGetConstantJoin(3));
		associationEndModifiersMapperMapperList.add(AssociationEndFinder.zGetConstantJoin(5));
		Mapper associationEndModifiersMapper = new MultiEqualityMapper(associationEndModifiersMapperMapperList);
		associationEndModifiersMapper.setName("associationEnd");
		return associationEndModifiersMapper;
	}

	private static Mapper orderBysReverseMapper = null;
	public static Mapper zGetAssociationEndOrderBysReverseMapper()
	{
		if (orderBysReverseMapper == null)
		{
			orderBysReverseMapper = zConstructAssociationEndOrderBysReverseMapper();
		}

		return orderBysReverseMapper;
	}

	private static Mapper orderBysMapper = null;
	public static Mapper zGetAssociationEndOrderBysMapper()
	{
		if (orderBysMapper == null)
		{
			orderBysMapper = zConstructAssociationEndOrderBysMapper();
		}

		return orderBysMapper;
	}

	private static Mapper orderBysPureReverseMapper = null;
	public static Mapper zGetAssociationEndOrderBysPureReverseMapper()
	{
		if (orderBysPureReverseMapper == null)
		{
			orderBysPureReverseMapper = zConstructAssociationEndOrderBysPureReverseMapper();
		}

		return orderBysPureReverseMapper;
	}

	private static Mapper zConstructAssociationEndOrderBysPureReverseMapper()
	{
		InternalList orderBysMapperMapperList = new InternalList(2);
		orderBysMapperMapperList.add(AssociationEndFinder.zGetConstantJoin(6));
		orderBysMapperMapperList.add(AssociationEndFinder.zGetConstantJoin(8));
		Mapper orderBysMapper = new MultiEqualityMapper(orderBysMapperMapperList);
		orderBysMapper.setName("orderBys");
		return orderBysMapper;
	}

	private static Mapper zConstructAssociationEndOrderBysReverseMapper()
	{
		InternalList orderBysMapperMapperList = new InternalList(2);
		orderBysMapperMapperList.add(AssociationEndFinder.zGetConstantJoin(6));
		orderBysMapperMapperList.add(AssociationEndFinder.zGetConstantJoin(8));
		Mapper orderBysMapper = new MultiEqualityMapper(orderBysMapperMapperList);
		orderBysMapper.setName("orderBys");
		return orderBysMapper;
	}

	private static Mapper zConstructAssociationEndOrderBysMapper()
	{
		InternalList orderBysMapperMapperList = new InternalList(2);
		orderBysMapperMapperList.add(AssociationEndFinder.zGetConstantJoin(7));
		orderBysMapperMapperList.add(AssociationEndFinder.zGetConstantJoin(9));
		Mapper orderBysMapper = new MultiEqualityMapper(orderBysMapperMapperList);
		orderBysMapper.setName("associationEnd");
		return orderBysMapper;
	}

	/** maps to \"ASSOCIATION_END\".\"OWNING_CLASS_NAME\" **/
	public static StringAttribute owningClassName()
	{
		return finder.owningClassName();
	}

	/** maps to \"ASSOCIATION_END\".\"NAME\" **/
	public static StringAttribute name()
	{
		return finder.name();
	}

	/** maps to \"ASSOCIATION_END\".\"ASSOCIATION_NAME\" **/
	public static StringAttribute associationName()
	{
		return finder.associationName();
	}

	/** maps to \"ASSOCIATION_END\".\"RESULT_TYPE_NAME\" **/
	public static StringAttribute resultTypeName()
	{
		return finder.resultTypeName();
	}

	/** maps to \"ASSOCIATION_END\".\"ORDINAL\" **/
	public static IntegerAttribute ordinal()
	{
		return finder.ordinal();
	}

	/** maps to \"ASSOCIATION_END\".\"DIRECTION\" **/
	public static StringAttribute direction()
	{
		return finder.direction();
	}

	/** maps to \"ASSOCIATION_END\".\"MULTIPLICITY\" **/
	public static StringAttribute multiplicity()
	{
		return finder.multiplicity();
	}

	public static KlassFinder.KlassSingleFinderForRelatedClasses resultType()
	{
		return finder.resultType();
	}

	public static class AssociationEndResultTypeFinderSubclass extends KlassFinder.KlassSingleFinderForRelatedClasses
	{
		public AssociationEndResultTypeFinderSubclass(Mapper mapper, NormalAndListValueSelector parentSelector )
		{
			super(mapper);
			this._parentSelector = (AbstractRelatedFinder) parentSelector;
			this._orderBy = null;
			this._type = SIMPLE_TO_ONE;
			this._name = "resultType";
		}

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

		protected Klass plainValueOf(AssociationEnd _obj)
		{
			return _obj.getResultType();
		}

		protected KlassList plainListValueOf(Object _obj)
		{
			return ((AssociationEndList)_obj).getResultTypes();
		}
	}

	public static AssociationEndModifierFinder.AssociationEndModifierCollectionFinderForRelatedClasses associationEndModifiers()
	{
		return finder.associationEndModifiers();
	}

	public static class AssociationEndAssociationEndModifiersFinderSubclass extends AssociationEndModifierFinder.AssociationEndModifierCollectionFinderForRelatedClasses
	{
		public AssociationEndAssociationEndModifiersFinderSubclass(Mapper mapper, NormalAndListValueSelector parentSelector )
		{
			super(mapper);
			this._parentSelector = (AbstractRelatedFinder) parentSelector;
			this._orderBy = AssociationEndModifierFinder.ordinal().ascendingOrderBy();
			this._type = SIMPLE_TO_MANY;
			this._name = "associationEndModifiers";
			this.zSetRelationshipMultiExtractor(RelationshipMultiExtractor.withLeftAttributes(
				AssociationEndModifierFinder.associationEndName(),
				AssociationEndModifierFinder.owningClassName()).withExtractors(
				AssociationEndFinder.name(),
				AssociationEndFinder.owningClassName()));
		}

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

		public boolean isModifiedSinceDetachment(MithraTransactionalObject _obj)
		{
			return ((AssociationEnd) _obj).isAssociationEndModifiersModifiedSinceDetachment();
		}

		protected AssociationEndModifierList plainValueOf(AssociationEnd _obj)
		{
			return _obj.getAssociationEndModifiers();
		}

		protected AssociationEndModifierList plainListValueOf(Object _obj)
		{
			return ((AssociationEndList)_obj).getAssociationEndModifiers();
		}
	}

	public static AssociationEndOrderByFinder.AssociationEndOrderByCollectionFinderForRelatedClasses orderBys()
	{
		return finder.orderBys();
	}

	public static class AssociationEndOrderBysFinderSubclass extends AssociationEndOrderByFinder.AssociationEndOrderByCollectionFinderForRelatedClasses
	{
		public AssociationEndOrderBysFinderSubclass(Mapper mapper, NormalAndListValueSelector parentSelector )
		{
			super(mapper);
			this._parentSelector = (AbstractRelatedFinder) parentSelector;
			this._orderBy = AssociationEndOrderByFinder.ordinal().ascendingOrderBy();
			this._type = SIMPLE_TO_MANY;
			this._name = "orderBys";
			this.zSetRelationshipMultiExtractor(RelationshipMultiExtractor.withLeftAttributes(
				AssociationEndOrderByFinder.associationEndClassName(),
				AssociationEndOrderByFinder.associationEndName()).withExtractors(
				AssociationEndFinder.owningClassName(),
				AssociationEndFinder.name()));
		}

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

		public boolean isModifiedSinceDetachment(MithraTransactionalObject _obj)
		{
			return ((AssociationEnd) _obj).isOrderBysModifiedSinceDetachment();
		}

		protected AssociationEndOrderByList plainValueOf(AssociationEnd _obj)
		{
			return _obj.getOrderBys();
		}

		protected AssociationEndOrderByList plainListValueOf(Object _obj)
		{
			return ((AssociationEndList)_obj).getOrderBys();
		}
	}

	public static AssociationFinder.AssociationSingleFinderForRelatedClasses owningAssociation()
	{
		return finder.owningAssociation();
	}

	public static class AssociationEndOwningAssociationFinderSubclass extends AssociationFinder.AssociationSingleFinderForRelatedClasses
	{
		public AssociationEndOwningAssociationFinderSubclass(Mapper mapper, NormalAndListValueSelector parentSelector )
		{
			super(mapper);
			this._parentSelector = (AbstractRelatedFinder) parentSelector;
			this._orderBy = null;
			this._type = SIMPLE_TO_ONE;
			this._name = "owningAssociation";
		}

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

		protected Association plainValueOf(AssociationEnd _obj)
		{
			return _obj.getOwningAssociation();
		}

		protected AssociationList plainListValueOf(Object _obj)
		{
			return ((AssociationEndList)_obj).getOwningAssociations();
		}
	}

	public static KlassFinder.KlassSingleFinderForRelatedClasses owningClass()
	{
		return finder.owningClass();
	}

	public static class AssociationEndOwningClassFinderSubclass extends KlassFinder.KlassSingleFinderForRelatedClasses
	{
		public AssociationEndOwningClassFinderSubclass(Mapper mapper, NormalAndListValueSelector parentSelector )
		{
			super(mapper);
			this._parentSelector = (AbstractRelatedFinder) parentSelector;
			this._orderBy = null;
			this._type = SIMPLE_TO_ONE;
			this._name = "owningClass";
		}

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

		protected Klass plainValueOf(AssociationEnd _obj)
		{
			return _obj.getOwningClass();
		}

		protected KlassList plainListValueOf(Object _obj)
		{
			return ((AssociationEndList)_obj).getOwningClass();
		}
	}

	public static MemberReferencePathAssociationEndMappingFinder.MemberReferencePathAssociationEndMappingCollectionFinderForRelatedClasses memberReferencePaths()
	{
		return finder.memberReferencePaths();
	}

	public static class AssociationEndMemberReferencePathsFinderSubclass extends MemberReferencePathAssociationEndMappingFinder.MemberReferencePathAssociationEndMappingCollectionFinderForRelatedClasses
	{
		public AssociationEndMemberReferencePathsFinderSubclass(Mapper mapper, NormalAndListValueSelector parentSelector )
		{
			super(mapper);
			this._parentSelector = (AbstractRelatedFinder) parentSelector;
			this._orderBy = null;
			this._type = SIMPLE_TO_MANY;
			this._name = "memberReferencePaths";
			this.zSetRelationshipMultiExtractor(RelationshipMultiExtractor.withLeftAttributes(
				MemberReferencePathAssociationEndMappingFinder.associationEndName(),
				MemberReferencePathAssociationEndMappingFinder.associationOwningClassName()).withExtractors(
				AssociationEndFinder.name(),
				AssociationEndFinder.owningClassName()));
		}

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

		protected MemberReferencePathAssociationEndMappingList plainValueOf(AssociationEnd _obj)
		{
			return _obj.getMemberReferencePaths();
		}

		protected MemberReferencePathAssociationEndMappingList plainListValueOf(Object _obj)
		{
			return ((AssociationEndList)_obj).getMemberReferencePaths();
		}
	}

	public static ProjectionWithAssociationEndFinder.ProjectionWithAssociationEndCollectionFinderForRelatedClasses projectionsWithAssociationEnd()
	{
		return finder.projectionsWithAssociationEnd();
	}

	public static class AssociationEndProjectionsWithAssociationEndFinderSubclass extends ProjectionWithAssociationEndFinder.ProjectionWithAssociationEndCollectionFinderForRelatedClasses
	{
		public AssociationEndProjectionsWithAssociationEndFinderSubclass(Mapper mapper, NormalAndListValueSelector parentSelector )
		{
			super(mapper);
			this._parentSelector = (AbstractRelatedFinder) parentSelector;
			this._orderBy = null;
			this._type = SIMPLE_TO_MANY;
			this._name = "projectionsWithAssociationEnd";
			this.zSetRelationshipMultiExtractor(RelationshipMultiExtractor.withLeftAttributes(
				ProjectionWithAssociationEndFinder.associationEndClass(),
				ProjectionWithAssociationEndFinder.associationEndName()).withExtractors(
				AssociationEndFinder.owningClassName(),
				AssociationEndFinder.name()));
		}

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

		protected ProjectionWithAssociationEndList plainValueOf(AssociationEnd _obj)
		{
			return _obj.getProjectionsWithAssociationEnd();
		}

		protected ProjectionWithAssociationEndList plainListValueOf(Object _obj)
		{
			return ((AssociationEndList)_obj).getProjectionsWithAssociationEnd();
		}
	}

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

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

	public static AssociationEndSingleFinder getFinderInstance()
	{
		return finder;
	}

	public static Attribute[] getPrimaryKeyAttributes()
	{
		return new Attribute[] 
		{
			owningClassName()
			, name()
		}

		;
	}

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

		;
	}

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

	protected static void initializeIndicies(Cache cache)
	{
		cache.addIndex("0 Index", new Attribute[] 
		{
			associationName()
		}

		);
		cache.addIndex("1 Index", new Attribute[] 
		{
			resultTypeName()
		}

		);
		cache.addIndex("2 Index", new Attribute[] 
		{
			owningClassName()
		}

		);
	}

	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[] 
		{
			AssociationFinder.getFinderInstance(),KlassFinder.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[] 
		{
			AssociationFinder.getFinderInstance(),KlassFinder.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.AssociationEnd");
		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