protected void InitIdentifierPropertyPaths(string path, EntityType etype, string[] columns, IMapping factory)
		{
			IType idtype = etype.GetIdentifierOrUniqueKeyType(factory);
			string idPropName = etype.GetIdentifierOrUniqueKeyPropertyName(factory);
			bool hasNonIdentifierPropertyNamedId = HasNonIdentifierPropertyNamedId(etype, factory);

			if (etype.IsReferenceToPrimaryKey)
			{
				if (!hasNonIdentifierPropertyNamedId)
				{
					string idpath1 = ExtendPath(path, EntityPersister.EntityID);
					AddPropertyPath(idpath1, idtype, columns, null);
					InitPropertyPaths(idpath1, idtype, columns, null, factory);
				}
			}

			if (idPropName != null)
			{
				string idpath2 = ExtendPath(path, idPropName);
				AddPropertyPath(idpath2, idtype, columns, null);
				InitPropertyPaths(idpath2, idtype, columns, null, factory);
			}
		}
		/// <summary>
		/// Determine the name of the property for the entity encapsulated by the
		/// given type which represents the id or unique-key.
		/// </summary>
		/// <param name="entityType">The type representing the entity.</param>
		/// <returns>The corresponding property name</returns>
		public string GetIdentifierOrUniqueKeyPropertyName(EntityType entityType)
		{
			try
			{
				return entityType.GetIdentifierOrUniqueKeyPropertyName(_sfi);
			}
			catch (MappingException me)
			{
				throw new QueryException(me);
			}
		}
		/// <summary>
		/// 
		/// </summary>
		/// <param name="propertyName"></param>
		/// <param name="propertyType"></param>
		/// <param name="q"></param>
		/// <remarks>NOTE: we avoid joining to the next table if the named property is just the foreign key value</remarks>
		private void DereferenceEntity(string propertyName, EntityType propertyType, QueryTranslator q)
		{
			//if its "id"
			bool isIdShortcut = EntityID.Equals(propertyName) && !propertyType.IsUniqueKeyReference;

			//or its the id property name
			string idPropertyName;
			try
			{
				idPropertyName = propertyType.GetIdentifierOrUniqueKeyPropertyName(q.Factory);
			}
			catch (MappingException me)
			{
				throw new QueryException(me);
			}
			bool isNamedIdPropertyShortcut = idPropertyName != null && idPropertyName.Equals(propertyName);

			if (isIdShortcut || isNamedIdPropertyShortcut)
			{
				// special shortcut for id properties, skip the join!
				// this must only occur at the _end_ of a path expression
				DereferenceProperty(propertyName);
			}
			else
			{
				string entityClass = propertyType.GetAssociatedEntityName();
				string name = q.CreateNameFor(entityClass);
				q.AddType(name, entityClass);
				//String[] keyColNames = memberPersister.getIdentifierColumnNames();
				AddJoin(name, propertyType);
                if (propertyType.IsOneToOne)
                {
                    oneToOneOwnerName = currentName;
                }
                else
                {
                    oneToOneOwnerName = null;
                }
				ownerAssociationType = propertyType;
				currentName = name;
				currentProperty = propertyName;
				q.AddPathAliasAndJoin(path.ToString(0, path.ToString().LastIndexOf(StringHelper.Dot)), name, joinSequence.Copy());
				componentPath.Length = 0;
				currentPropertyMapping = q.GetPersister(entityClass);
			}
		}
		/// <summary>
		/// 
		/// </summary>
		/// <param name="path"></param>
		/// <param name="etype"></param>
		/// <param name="columns"></param>
		/// <param name="factory"></param>
		protected void InitIdentifierPropertyPaths( string path, EntityType etype, string[] columns, ISessionFactoryImplementor factory )
		{
			IType idtype = etype.GetIdentifierOrUniqueKeyType( factory );

			if ( !etype.IsUniqueKeyReference )
			{
				string idpath1 = ExtendPath( path, PathExpressionParser.EntityID );
				AddPropertyPath( idpath1, idtype, columns );
				InitPropertyPaths( idpath1, idtype, columns, factory );
			}

			string idPropName = etype.GetIdentifierOrUniqueKeyPropertyName( factory );
			if ( idPropName!=null )
			{
				string idpath2 = ExtendPath( path, idPropName );
				AddPropertyPath( idpath2, idtype, columns );
				InitPropertyPaths( idpath2, idtype, columns, factory );
			}
		}