Пример #1
0
        private void DereferenceCollection(String propertyName, String role, QueryTranslator q)
        {
            collectionRole = role;
            IQueryableCollection collPersister = q.GetCollectionPersister(role);
            string name = q.CreateNameForCollection(role);

            AddJoin(name, collPersister.CollectionType);

            //if ( collPersister.HasWhere )
            //{
            //    join.AddCondition( collPersister.GetSQLWhereString( name ) );
            //}

            collectionName       = name;
            collectionOwnerName  = currentName;
            currentName          = name;
            currentProperty      = propertyName;
            componentPath.Length = 0;
            //componentPath = new StringBuilder();
            currentPropertyMapping = new CollectionPropertyMapping(collPersister);
        }
Пример #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="q"></param>
        public virtual void End(QueryTranslator q)
        {
            ignoreInitialJoin = false;

            IType propertyType = PropertyType;

            if (propertyType != null && propertyType.IsCollectionType)
            {
                collectionRole = ((CollectionType)propertyType).Role;
                collectionName = q.CreateNameForCollection(collectionRole);
                PrepareForIndex(q);
            }
            else
            {
                columns = CurrentColumns();
                SetType(q);
            }

            //important!!
            continuation = false;
        }
        private void DereferenceCollection(String propertyName, String role, QueryTranslator q)
        {
            collectionRole = role;
            IQueryableCollection collPersister = q.GetCollectionPersister(role);

            string[] colNames = collPersister.KeyColumnNames;
            string   name     = q.CreateNameForCollection(role);

            AddJoin(collPersister.TableName, name, colNames);

            if (collPersister.HasWhere)
            {
                join.AddCondition(collPersister.GetSQLWhereString(name));
            }
            collectionName      = name;
            collectionOwnerName = currentName;
            currentName         = name;
            currentProperty     = propertyName;
            componentPath       = null;
            //componentPath = new StringBuilder();
            currentPropertyMapping = new CollectionPropertyMapping(collPersister);
        }