public void AddToQuery(AuditConfiguration auditCfg, String entityName, QueryBuilder qb, Parameters parameters) { String propertyName = propertyNameGetter.Get(auditCfg); CriteriaTools.CheckPropertyNotARelation(auditCfg, entityName, propertyName); parameters.AddWhereWithParams(propertyName, "in (", values, ")"); }
public void AddToQuery(AuditConfiguration auditCfg, String entityName, QueryBuilder qb, Parameters parameters) { String propertyName = propertyNameGetter.Get(auditCfg); CriteriaTools.CheckPropertyNotARelation(auditCfg, entityName, propertyName); // This will be the aggregated query, containing all the specified conditions QueryBuilder subQb = qb.NewSubQueryBuilder(); // Adding all specified conditions both to the main query, as well as to the // aggregated one. foreach (IAuditCriterion versionsCriteria in criterions) { versionsCriteria.AddToQuery(auditCfg, entityName, qb, parameters); versionsCriteria.AddToQuery(auditCfg, entityName, subQb, subQb.RootParameters); } // Setting the desired projection of the aggregated query switch (mode) { case AggregatedMode.MIN: subQb.AddProjection("min", propertyName, false); break; case AggregatedMode.MAX: subQb.AddProjection("max", propertyName, false); break; } // Adding the constrain on the result of the aggregated criteria parameters.AddWhere(propertyName, "=", subQb); }
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); } }
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) { throw new AuditException("This criterion can only be used on a property that is " + "a relation to another property."); } else { relatedEntity.IdMapper.AddIdEqualsToQuery(parameters, id, propertyName, equals); } }
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)); } }
public Pair <String, Boolean> getData(AuditConfiguration auditCfg) { return(Pair <String, Boolean> .Make(propertyNameGetter.Get(auditCfg), asc)); }
public Tuple <string, string, bool> GetData(AuditConfiguration auditCfg) { return(new Tuple <string, string, bool>(null, _propertyNameGetter.Get(auditCfg), false)); }
public Tuple <string, string, bool> GetData(AuditConfiguration auditCfg) { var propertyName = _propertyNameGetter.Get(auditCfg); return(new Tuple <string, string, bool>(_function, propertyName, _distinct)); }
public static string DeterminePropertyName(AuditConfiguration auditCfg, IAuditReaderImplementor versionsReader, string entityName, IPropertyNameGetter propertyNameGetter) { return(DeterminePropertyName(auditCfg, versionsReader, entityName, propertyNameGetter.Get(auditCfg))); }
public Tuple <string, bool> GetData(AuditConfiguration auditCfg) { return(new Tuple <String, Boolean>(_propertyNameGetter.Get(auditCfg), _asc)); }
// Projection on this property public Triple <String, String, Boolean> GetData(AuditConfiguration auditCfg) { return(Triple <String, String, Boolean> .Make <String, String, Boolean>(null, propertyNameGetter.Get(auditCfg), false)); }
public Triple <String, String, Boolean> GetData(AuditConfiguration auditCfg) { String propertyName = propertyNameGetter.Get(auditCfg); return(Triple <String, String, Boolean> .Make(function, propertyName, distinct)); }
public string Get(AuditConfiguration auditCfg) { return(MetadataTools.ModifiedFlagPropertyName(_propertyNameGetter.Get(auditCfg), auditCfg.GlobalCfg.ModifiedFlagSuffix)); }