Exemple #1
0
        /// <summary> Gets a scalar value, calculated with the aggregate and expression specified. the field index specified is the field the expression and aggregate are applied on.</summary>
        /// <param name="fieldIndex">Field index of field to which to apply the aggregate function and expression</param>
        /// <param name="expressionToExecute">The expression to execute. Can be null</param>
        /// <param name="aggregateToApply">Aggregate function to apply. </param>
        /// <param name="filter">The filter to apply to retrieve the scalar</param>
        /// <param name="relations">The relations to walk</param>
        /// <param name="groupByClause">The groupby clause to apply to retrieve the scalar</param>
        /// <returns>the scalar value requested</returns>
        public virtual object GetScalar(SpecialOfferFieldIndex fieldIndex, IExpression expressionToExecute, AggregateFunction aggregateToApply, IPredicate filter, IRelationCollection relations, IGroupByCollection groupByClause)
        {
            EntityFields fields = new EntityFields(1);

            fields[0] = EntityFieldFactory.Create(fieldIndex);
            if ((fields[0].ExpressionToApply == null) || (expressionToExecute != null))
            {
                fields[0].ExpressionToApply = expressionToExecute;
            }
            if ((fields[0].AggregateFunctionToApply == AggregateFunction.None) || (aggregateToApply != AggregateFunction.None))
            {
                fields[0].AggregateFunctionToApply = aggregateToApply;
            }
            SpecialOfferDAO dao = DAOFactory.CreateSpecialOfferDAO();

            return(dao.GetScalar(fields, base.Transaction, filter, relations, groupByClause));
        }
Exemple #2
0
 /// <summary> Gets a scalar value, calculated with the aggregate and expression specified. the field index specified is the field the expression and aggregate are applied on.</summary>
 /// <param name="fieldIndex">Field index of field to which to apply the aggregate function and expression</param>
 /// <param name="expressionToExecute">The expression to execute. Can be null</param>
 /// <param name="aggregateToApply">Aggregate function to apply. </param>
 /// <returns>the scalar value requested</returns>
 public object GetScalar(SpecialOfferFieldIndex fieldIndex, IExpression expressionToExecute, AggregateFunction aggregateToApply)
 {
     return(GetScalar(fieldIndex, expressionToExecute, aggregateToApply, null, null, null));
 }
Exemple #3
0
 /// <summary> Gets a scalar value, calculated with the aggregate. the field index specified is the field the aggregate are applied on.</summary>
 /// <param name="fieldIndex">Field index of field to which to apply the aggregate function and expression</param>
 /// <param name="aggregateToApply">Aggregate function to apply. </param>
 /// <returns>the scalar value requested</returns>
 public object GetScalar(SpecialOfferFieldIndex fieldIndex, AggregateFunction aggregateToApply)
 {
     return(GetScalar(fieldIndex, null, aggregateToApply, null, null, null));
 }
Exemple #4
0
 /// <summary>Creates a new sort clause for the SpecialOfferEntity field specified.</summary>
 public static ISortClause Create(SpecialOfferFieldIndex fieldToSort, SortOperator operatorToUse, string objectAlias)
 {
     return(new SortClause(EntityFieldFactory.Create(fieldToSort), operatorToUse, objectAlias));
 }
 /// <summary>Creates a new sort clause for the SpecialOfferEntity field specified.</summary>
 public static ISortClause Create(SpecialOfferFieldIndex fieldToSort, SortOperator operatorToUse, string objectAlias)
 {
     return new SortClause(EntityFieldFactory.Create(fieldToSort), null, operatorToUse, objectAlias);
 }
 /// <summary>Returns true if the original value for the field with the fieldIndex passed in, read from the persistent storage was NULL, false otherwise.
 /// Should not be used for testing if the current value is NULL, use <see cref="TestCurrentFieldValueForNull"/> for that.</summary>
 /// <param name="fieldIndex">Index of the field to test if that field was NULL in the persistent storage</param>
 /// <returns>true if the field with the passed in index was NULL in the persistent storage, false otherwise</returns>
 public bool TestOriginalFieldValueForNull(SpecialOfferFieldIndex fieldIndex)
 {
     return base.Fields[(int)fieldIndex].IsNull;
 }
 /// <summary>FieldBetweenPredicate factory for SpecialOfferEntity.</summary>
 public static FieldBetweenPredicate Between(SpecialOfferFieldIndex indexOfField, object valueBegin, object valueEnd, string objectAlias, bool negate)
 {
     return new FieldBetweenPredicate(EntityFieldFactory.Create(indexOfField), null, valueBegin, valueEnd, objectAlias, negate);
 }
 /// <summary>Creates the specified field on the position indexInResultset in the resultset.</summary>
 /// <param name="fieldToDefine">The specification of the field to create.</param>
 /// <param name="indexInResultset">The position in the resultset where the field will be created on</param>
 /// <param name="alias">The alias to use for this field in the resultset</param>
 /// <param name="entityAlias">The alias to use for the entity this field belongs to. Required to specify multiple times the same entity in a typed list</param>
 public void DefineField(SpecialOfferFieldIndex fieldToDefine, int indexInResultset, string alias, string entityAlias)
 {
     DefineField(fieldToDefine, indexInResultset, alias, entityAlias, AggregateFunction.None);
 }
 /// <summary>FieldLikePredicate factory for SpecialOfferEntity.</summary>
 public static FieldLikePredicate Like(SpecialOfferFieldIndex indexOfField, string objectAlias, string pattern, bool negate)
 {
     return new FieldLikePredicate(EntityFieldFactory.Create(indexOfField), null, objectAlias, pattern, negate);
 }
 /// <summary>FieldLikePredicate factory for SpecialOfferEntity.</summary>
 public static FieldLikePredicate Like(SpecialOfferFieldIndex indexOfField, string pattern)
 {
     return new FieldLikePredicate(EntityFieldFactory.Create(indexOfField), null, pattern);
 }
 /// <summary>FieldCompareValuePredicate factory for SpecialOfferEntity.</summary>
 public static FieldCompareValuePredicate CompareValue(SpecialOfferFieldIndex indexOfField, ComparisonOperator operatorToUse, object value, string objectAlias, bool negate)
 {
     return new FieldCompareValuePredicate(EntityFieldFactory.Create(indexOfField), null, operatorToUse, value, objectAlias, negate);
 }
 /// <summary>FieldCompareRangePredicate factory for SpecialOfferEntity.</summary>
 public static FieldCompareRangePredicate CompareRange(SpecialOfferFieldIndex indexOfField, string objectAlias, bool negate, params object[] values)
 {
     return new FieldCompareRangePredicate(EntityFieldFactory.Create(indexOfField), null, objectAlias, negate, values);
 }
 /// <summary>FieldCompareNullPredicate factory for SpecialOfferEntity.</summary>
 public static FieldCompareNullPredicate CompareNull(SpecialOfferFieldIndex indexOfField, string objectAlias, bool negate)
 {
     return new FieldCompareNullPredicate(EntityFieldFactory.Create(indexOfField), null, objectAlias, negate);
 }
 /// <summary>FieldCompareNullPredicate factory for SpecialOfferEntity.</summary>
 public static FieldCompareNullPredicate CompareNull(SpecialOfferFieldIndex indexOfField)
 {
     return new FieldCompareNullPredicate(EntityFieldFactory.Create(indexOfField), null);
 }
 /// <summary>FieldCompareExpressionPredicate factory for SpecialOfferEntity.</summary>
 public static FieldCompareExpressionPredicate CompareExpression(SpecialOfferFieldIndex indexOfField, ComparisonOperator operatorToUse, IExpression expressionToCompareWith, string objectAlias, bool negate)
 {
     return new FieldCompareExpressionPredicate(EntityFieldFactory.Create(indexOfField), null, operatorToUse, expressionToCompareWith, objectAlias, negate);
 }
Exemple #16
0
 /// <summary> Gets a scalar value, calculated with the aggregate and expression specified. the field index specified is the field the expression and aggregate are applied on.</summary>
 /// <param name="fieldIndex">Field index of field to which to apply the aggregate function and expression</param>
 /// <param name="expressionToExecute">The expression to execute. Can be null</param>
 /// <param name="aggregateToApply">Aggregate function to apply. </param>
 /// <param name="filter">The filter to apply to retrieve the scalar</param>
 /// <param name="groupByClause">The groupby clause to apply to retrieve the scalar</param>
 /// <returns>the scalar value requested</returns>
 public object GetScalar(SpecialOfferFieldIndex fieldIndex, IExpression expressionToExecute, AggregateFunction aggregateToApply, IPredicate filter, IGroupByCollection groupByClause)
 {
     return(GetScalar(fieldIndex, expressionToExecute, aggregateToApply, filter, null, groupByClause));
 }
        /// <summary> Creates a new IEntityField2 instance for usage in the EntityFields object for the SpecialOfferEntity. Which EntityField is created is specified by fieldIndex</summary>
        /// <param name="fieldIndex">The field which IEntityField2 instance should be created</param>
        /// <returns>The IEntityField2 instance for the field specified in fieldIndex</returns>
        public static IEntityField2 Create(SpecialOfferFieldIndex fieldIndex)
        {
            IEntityField2 fieldToReturn = null;
            switch(fieldIndex)
            {
                case SpecialOfferFieldIndex.Id:
                    fieldToReturn = new EntityField2("Id", "SpecialOfferEntity", typeof(System.Int32), TypeDefaultValue.GetDefaultValue(typeof(System.Int32)), true, (int)fieldIndex, 0, 0, 10, false, true, false);
                    break;
                case SpecialOfferFieldIndex.ProductId:
                    fieldToReturn = new EntityField2("ProductId", "SpecialOfferEntity", typeof(System.Int32), TypeDefaultValue.GetDefaultValue(typeof(System.Int32)), false, (int)fieldIndex, 0, 0, 10, true, false, true);
                    break;
                case SpecialOfferFieldIndex.Number:
                    fieldToReturn = new EntityField2("Number", "SpecialOfferEntity", typeof(System.Int16), TypeDefaultValue.GetDefaultValue(typeof(System.Int16)), false, (int)fieldIndex, 0, 0, 5, false, false, true);
                    break;

            }
            return fieldToReturn;
        }
 /// <summary>Returns true if the current value for the field with the fieldIndex passed in represents null/not defined, false otherwise.
 /// Should not be used for testing if the original value (read from the db) is NULL</summary>
 /// <param name="fieldIndex">Index of the field to test if its currentvalue is null/undefined</param>
 /// <returns>true if the field's value isn't defined yet, false otherwise</returns>
 public bool TestCurrentFieldValueForNull(SpecialOfferFieldIndex fieldIndex)
 {
     return base.CheckIfCurrentFieldValueIsNull((int)fieldIndex);
 }
 /// <summary>Creates the specified field on the position indexInResultset in the resultset.</summary>
 /// <param name="fieldToDefine">The specification of the field to create.</param>
 /// <param name="indexInResultset">The position in the resultset where the field will be created on</param>
 /// <param name="alias">The alias to use for this field in the resultset</param>
 /// <param name="entityAlias">The alias to use for the entity this field belongs to. Required to specify multiple times the same entity in a typed list</param>
 /// <param name="aggregateFunctionToApply">the aggregate function to apply to this field.</param>
 public void DefineField(SpecialOfferFieldIndex fieldToDefine, int indexInResultset, string alias, string entityAlias, AggregateFunction aggregateFunctionToApply)
 {
     IEntityField2 fieldToAdd = EntityFieldFactory.Create(fieldToDefine);
     fieldToAdd.Alias = alias;
     fieldToAdd.ObjectAlias = entityAlias;
     fieldToAdd.AggregateFunctionToApply = aggregateFunctionToApply;
     base[indexInResultset] = fieldToAdd;
 }
 /// <summary>FieldBetweenPredicate factory for SpecialOfferEntity.</summary>
 public static FieldBetweenPredicate Between(SpecialOfferFieldIndex indexOfField, object valueBegin, object valueEnd)
 {
     return new FieldBetweenPredicate(EntityFieldFactory.Create(indexOfField), null, valueBegin, valueEnd);
 }