| Previous CloneSet | Next CloneSet | Back to Main Report |
| Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
|---|---|---|---|---|
| 13 | 3 | 4 | 0.978 | class_member_declaration |
| Clone Abstraction | Parameter Bindings |
| Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
|---|---|---|---|
| 1 | 13 | 386 | src/NHibernate.Test/HQL/HQLFunctions.cs |
| 2 | 12 | 402 | src/NHibernate.Test/HQL/HQLFunctions.cs |
| 3 | 13 | 796 | src/NHibernate.Test/HQL/HQLFunctions.cs |
| ||||
[Test]
public void Bit_length()
{
IgnoreIfNotSupported("bit_length");
// test only the parser
using (ISession s = OpenSession())
{
string hql = "from Animal a where bit_length(a.Description) = 24";
IList result = s.CreateQuery(hql).List();
hql = "select bit_length(a.Description) from Animal a";
result = s.CreateQuery(hql).List();
}
}
|
| ||||
[Test]
public void Coalesce()
{
IgnoreIfNotSupported("coalesce");
// test only the parser and render
using (ISession s = OpenSession())
{
string hql = "select coalesce(h.NickName, h.Name.First, h.Name.Last) from Human h";
IList result = s.CreateQuery(hql).List();
hql = "from Human h where coalesce(h.NickName, h.Name.First, h.Name.Last) = 'max'";
result = s.CreateQuery(hql).List();
}
}
|
| ||||
[Test]
public void Extract()
{
IgnoreIfNotSupported("extract");
// test only the parser and render
using (ISession s = OpenSession())
{
string hql = "select extract(second from current_timestamp()), extract(minute from current_timestamp()), extract(hour from current_timestamp()) from Animal";
IList result = s.CreateQuery(hql).List();
hql = "from Animal where extract(day from cast(current_timestamp() as Date))>0";
result = s.CreateQuery(hql).List();
}
}
|
| |||
[Test]
public void [[#variable2d0eb620]]()
{
IgnoreIfNotSupported( [[#variable2d0eb5c0]]);
// test only the parser
// test only the parser and render
using (ISession s = OpenSession())
{
string hql = [[#variable2d0eb560]];
IList result = s.CreateQuery(hql).List();
hql = [[#variable2d0eb4e0]];
result = s.CreateQuery(hql).List();
}
}
|
| CloneAbstraction |
| Parameter Index | Clone Instance | Parameter Name | Value |
|---|---|---|---|
| 1 | 1 | [[#2d0eb620]] | Bit_length |
| 1 | 2 | [[#2d0eb620]] | Coalesce |
| 1 | 3 | [[#2d0eb620]] | Extract |
| 2 | 1 | [[#2d0eb5c0]] | "bit_length" |
| 2 | 2 | [[#2d0eb5c0]] | "coalesce" |
| 2 | 3 | [[#2d0eb5c0]] | "extract" |
| 3 | 1 | [[#2d0eb560]] | "from Animal a where bit_length(a.Description) = 24" |
| 3 | 2 | [[#2d0eb560]] | "select coalesce(h.NickName, h.Name.First, h.Name.Last) from Human h" |
| 3 | 3 | [[#2d0eb560]] | "select extract(second from current_timestamp()), extract(minute from current_timestamp()), extract(hour from current_timestamp()) from Animal" |
| 4 | 1 | [[#2d0eb4e0]] | "select bit_length(a.Description) from Animal a" |
| 4 | 2 | [[#2d0eb4e0]] | "from Human h where coalesce(h.NickName, h.Name.First, h.Name.Last) = 'max'" |
| 4 | 3 | [[#2d0eb4e0]] | "from Animal where extract(day from cast(current_timestamp() as Date))>0" |