public CamlExpression GetExpression(Func <SPModelQueryFieldInfo, CamlExpression> expressionFactory, bool checkOrderable)
        {
            CommonHelper.AccessNotNull(expressionFactory, "expressionFactory");

            if (this.FieldAssociations == null)
            {
                CommonHelper.AccessNotNull(this.Field.FieldRef, "FieldRef");
                return(expressionFactory(this.Field));
            }
            if (!this.FieldAssociations.Queryable)
            {
                throw new Exception(String.Format("Member '{0}' must have exactly one SPFieldAttribute with IncludeInQuery set to true", this.Member.Name));
            }
            if (this.FieldAssociations.Fields.Count > 1 && checkOrderable)
            {
                throw new Exception(String.Format("Member '{0}' cannot be used in ordering", this.Member.Name));
            }
            if (definedValue != null)
            {
                foreach (SPModelFieldAssociation association in this.FieldAssociations)
                {
                    if (association.QueryProperty != null && definedValue.GetType().IsOf(association.QueryProperty.DeclaringType))
                    {
                        definedValue = association.QueryProperty.GetValue <object>(definedValue);
                        break;
                    }
                }
            }
            CamlExpression expression = Caml.False;

            foreach (SPModelFieldAssociation association in this.FieldAssociations)
            {
                SPModelQueryFieldInfo fieldInfo = new SPModelQueryFieldInfo(visitor.Manager.Site, association);
                if (visitor.IsFieldAllowed(fieldInfo.FieldRef))
                {
                    if (this.FieldAssociations.Fields.Count == 1)
                    {
                        return(expressionFactory(fieldInfo));
                    }
                    expression |= (association.Descriptor.GetContentTypeExpression(visitor.Manager.Descriptor) + expressionFactory(fieldInfo));
                }
            }
            return(expression);
        }