forked from nhibernate/nhibernate-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOracle12cDialect.cs
47 lines (41 loc) · 1.18 KB
/
Oracle12cDialect.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
using NHibernate.SqlCommand;
namespace NHibernate.Dialect
{
/// <summary>
/// A dialect specifically for use with Oracle 12c.
/// </summary>
/// <remarks>
/// The main difference between this dialect and <see cref="Oracle12cDialect"/>
/// is the use of "ANSI join syntax" here...
/// </remarks>
public class Oracle12cDialect : Oracle10gDialect
{
/// <summary>
/// Oracle 12c supports a query statement that provides <c>LIMIT</c>
/// functionality with an offset.
/// </summary>
/// <value><c>false</c></value>
public override bool UseMaxForLimit
{
get { return false; }
}
public override SqlString GetLimitString(SqlString querySqlString, SqlString offset, SqlString limit)
{
var result = new SqlStringBuilder(querySqlString);
if (offset != null)
{
result.Add(" OFFSET ");
result.Add(offset).Add(" ROWS");
}
if (limit != null)
{
result.Add(" FETCH FIRST ").Add(limit).Add(" ROWS ONLY");
}
return result.ToSqlString();
}
// 128 since 12.2. https://stackoverflow.com/a/756569/1178314, will
// have to do a 12-2c dialect for exploiting it, or wait for 13.
// / <inheritdoc />
//public override int MaxAliasLength => 128;
}
}