public void AddToQuery(AuditConfiguration auditCfg, String entityName, QueryBuilder qb, Parameters parameters)
        {
            String propertyName = propertyNameGetter.Get(auditCfg);

            CriteriaTools.CheckPropertyNotARelation(auditCfg, entityName, propertyName);
            parameters.AddWhereWithParam(propertyName, ">=", lo);
            parameters.AddWhereWithParam(propertyName, "<=", hi);
        }
Exemplo n.º 2
0
        public void AddIdEqualsToQuery(Parameters parameters, Object id, String prefix, bool equals)
        {
            IList <QueryParameterData> paramDatas = MapToQueryParametersFromId(id);

            Parameters parametersToUse = GetParametersToUse(parameters, paramDatas);

            foreach (QueryParameterData paramData in paramDatas)
            {
                parametersToUse.AddWhereWithParam(paramData.getProperty(prefix), equals ? "=" : "<>", paramData.getValue());
            }
        }
Exemplo n.º 3
0
        public void AddToQuery(AuditConfiguration auditCfg, String entityName, QueryBuilder qb, Parameters parameters)
        {
            String propertyName = propertyNameGetter.Get(auditCfg);
            RelationDescription relatedEntity = CriteriaTools.GetRelatedEntity(auditCfg, entityName, propertyName);

            if (relatedEntity == null)
            {
                parameters.AddWhereWithParam(propertyName, "=", null);
            }
            else
            {
                relatedEntity.IdMapper.AddIdEqualsToQuery(parameters, null, propertyName, true);
            }
        }
Exemplo n.º 4
0
        public void AddToQuery(AuditConfiguration auditCfg, IAuditReaderImplementor versionsReader, string entityName, QueryBuilder qb, Parameters parameters)
        {
            var propertyName = CriteriaTools.DeterminePropertyName(auditCfg, versionsReader, entityName, propertyNameGetter);

            var relatedEntity = CriteriaTools.GetRelatedEntity(auditCfg, entityName, propertyName);

            if (relatedEntity == null)
            {
                parameters.AddWhereWithParam(propertyName, op, value);
            }
            else
            {
                if (!"=".Equals(op) && !"<>".Equals(op))
                {
                    throw new AuditException("This type of operation: " + op + " (" + entityName + "." + propertyName +
                                             ") isn't supported and can't be used in queries.");
                }

                var id = relatedEntity.IdMapper.MapToIdFromEntity(value);

                relatedEntity.IdMapper.AddIdEqualsToQuery(parameters, id, null, "=".Equals(op));
            }
        }
Exemplo n.º 5
0
        public void AddToQuery(AuditConfiguration auditCfg, String entityName, QueryBuilder qb, Parameters parameters)
        {
            String propertyName = propertyNameGetter.Get(auditCfg);

            RelationDescription relatedEntity = CriteriaTools.GetRelatedEntity(auditCfg, entityName, propertyName);

            if (relatedEntity == null)
            {
                parameters.AddWhereWithParam(propertyName, op, value);
            }
            else
            {
                if (!"=".Equals(op) && !"<>".Equals(op))
                {
                    throw new AuditException("This type of operation: " + op + " (" + entityName + "." + propertyName +
                                             ") isn't supported and can't be used in queries.");
                }

                Object id = relatedEntity.IdMapper.MapToIdFromEntity(value);

                relatedEntity.IdMapper.AddIdEqualsToQuery(parameters, id, propertyName, "=".Equals(op));
            }
        }
Exemplo n.º 6
0
 public void AddToQuery(AuditConfiguration auditCfg, IAuditReaderImplementor versionsReader, string entityName, QueryBuilder qb, Parameters parameters)
 {
     parameters.AddWhereWithParam(auditCfg.AuditEntCfg.RevisionTypePropName, _op, _value);
 }