| Previous CloneSet | Next CloneSet | Back to Main Report |
| Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
|---|---|---|---|---|
| 13 | 2 | 5 | 0.977 | class_member_declaration |
| Clone Abstraction | Parameter Bindings |
| Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
|---|---|---|---|
| 1 | 13 | 95 | src/NHibernate.Test/NHSpecificTest/NH1280/NH1280Fixture.cs |
| 2 | 13 | 112 | src/NHibernate.Test/NHSpecificTest/NH1280/NH1280Fixture.cs |
| ||||
[Test]
public void HavingOnLtAverage()
{
using (ISession s = OpenSession())
{
using (ITransaction tx = s.BeginTransaction())
{
//Find the iq that two people share
string name = s.CreateCriteria( typeof(Person)).
SetProjection(Projections.GroupProperty("Name")).
Add (Restrictions.Lt(Projections.Avg("IQ"), 20)).UniqueResult<string> ();
Assert.AreEqual("Joe", name);
tx.Commit();
}
}
}
|
| ||||
[Test]
public void HavingOnEqProjection()
{
using (ISession s = OpenSession())
{
using (ITransaction tx = s.BeginTransaction())
{
//SELECT this_.Name as y0_ FROM Person this_ GROUP BY this_.Name HAVING this_.Name = @p0; @p0 = 'Joe'
string name = s.CreateCriteria( typeof(Person)).
SetProjection(Projections.GroupProperty("Name")).
Add (Restrictions.Eq(Projections.GroupProperty("Name"), "Joe")).UniqueResult<string> ();
Assert.AreEqual("Joe", name);
tx.Commit();
}
}
}
|
| |||
[Test]
public void [[#variable297b4300]]()
{
using (ISession s = OpenSession())
{
using (ITransaction tx = s.BeginTransaction())
{
//Find the iq that two people share
//SELECT this_.Name as y0_ FROM Person this_ GROUP BY this_.Name HAVING this_.Name = @p0; @p0 = 'Joe'
string name = s.CreateCriteria( typeof(Person)).SetProjection(Projections.GroupProperty("Name")).Add(Restrictions. [[#variable297b42a0]](Projections. [[#variable297b4220]]( [[#variable297b4160]]), [[#variable297b40c0]])).UniqueResult<string> ();
Assert.AreEqual("Joe", name);
tx.Commit();
}
}
}
|
| CloneAbstraction |
| Parameter Index | Clone Instance | Parameter Name | Value |
|---|---|---|---|
| 1 | 1 | [[#297b4300]] | HavingOnLtAverage |
| 1 | 2 | [[#297b4300]] | HavingOnEqProjection |
| 2 | 1 | [[#297b42a0]] | Lt |
| 2 | 2 | [[#297b42a0]] | Eq |
| 3 | 1 | [[#297b4220]] | Avg |
| 3 | 2 | [[#297b4220]] | GroupProperty |
| 4 | 1 | [[#297b4160]] | "IQ" |
| 4 | 2 | [[#297b4160]] | "Name" |
| 5 | 1 | [[#297b40c0]] | 20 |
| 5 | 2 | [[#297b40c0]] | "Joe" |