forked from nhibernate/nhibernate-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIProjection.cs
92 lines (82 loc) · 3.79 KB
/
IProjection.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
using System;
using System.Data.Common;
using NHibernate.SqlCommand;
using NHibernate.Engine;
using NHibernate.Loader.Criteria;
using NHibernate.Type;
namespace NHibernate.Criterion
{
public interface IProjection
{
/// <summary>
/// Render the SQL Fragment.
/// </summary>
/// <param name="criteria">The criteria.</param>
/// <param name="position">The position.</param>
/// <param name="criteriaQuery">The criteria query.</param>
/// <returns></returns>
SqlString ToSqlString(ICriteria criteria, int position, ICriteriaQuery criteriaQuery);
/// <summary>
/// Render the SQL Fragment to be used in the Group By Clause.
/// </summary>
/// <param name="criteria">The criteria.</param>
/// <param name="criteriaQuery">The criteria query.</param>
/// <returns></returns>
SqlString ToGroupSqlString(ICriteria criteria, ICriteriaQuery criteriaQuery);
/// <summary>
/// Return types for a particular user-visible alias
/// </summary>
/// <param name="criteria"></param>
/// <param name="criteriaQuery"></param>
/// <returns></returns>
IType[] GetTypes(ICriteria criteria, ICriteriaQuery criteriaQuery);
/// <summary>
///
/// </summary>
/// <param name="alias"></param>
/// <param name="criteria"></param>
/// <param name="criteriaQuery"></param>
/// <returns></returns>
IType[] GetTypes(string alias, ICriteria criteria, ICriteriaQuery criteriaQuery);
/// <summary>
/// Get the user-visible aliases for this projection (ie. the ones that will be passed to the ResultTransformer)
/// </summary>
string[] Aliases { get; }
/// <summary>
/// Does this projection specify grouping attributes?
/// </summary>
bool IsGrouped { get; }
/// <summary>
/// Does this projection specify aggregate attributes?
/// </summary>
bool IsAggregate { get; }
/// <summary>
/// Gets the typed values for parameters in this projection
/// </summary>
/// <param name="criteria">The criteria.</param>
/// <param name="criteriaQuery">The criteria query.</param>
/// <returns></returns>
TypedValue[] GetTypedValues(ICriteria criteria, ICriteriaQuery criteriaQuery);
/// <summary>
/// Get the SQL column aliases used by this projection for the columns it writes for inclusion into the
/// <code>SELECT</code> clause <see cref="IProjection.ToSqlString" />. NHibernate always uses column aliases
/// to extract data from the <see cref="DbDataReader" />, so it is important that these be implemented
/// correctly in order for NHibernate to be able to extract these values correctly.
/// </summary>
/// <param name="position">Just as in <see cref="IProjection.ToSqlString" />, represents the number of columns rendered prior to this projection.</param>
/// <param name="criteria">The local criteria to which this project is attached (for resolution).</param>
/// <param name="criteriaQuery">The overall criteria query instance.</param>
/// <returns>The columns aliases.</returns>
string[] GetColumnAliases(int position, ICriteria criteria, ICriteriaQuery criteriaQuery);
/// <summary>
/// Get the SQL column aliases used by this projection for the columns it writes for inclusion into the
/// <code>SELECT</code> clause (<see cref="IProjection.ToSqlString" />) for a particular criteria-level alias.
/// </summary>
/// <param name="alias">The criteria-level alias.</param>
/// <param name="position">Just as in <see cref="IProjection.ToSqlString" />, represents the number of columns rendered prior to this projection.</param>
/// <param name="criteria">The local criteria to which this project is attached (for resolution).</param>
/// <param name="criteriaQuery">The overall criteria query instance.</param>
/// <returns>The columns aliases.</returns>
string[] GetColumnAliases(string alias, int position, ICriteria criteria, ICriteriaQuery criteriaQuery);
}
}