| Previous CloneSet | Next CloneSet | Back to Main Report |
| Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
|---|---|---|---|---|
| 54 | 2 | 3 | 0.971 | compilation_unit |
| Clone Abstraction | Parameter Bindings |
| Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
|---|---|---|---|
| 1 | 54 | 1 | src/NHibernate/Engine/Query/Sql/NativeSQLQueryCollectionReturn.cs |
| 2 | 45 | 1 | src/NHibernate/Engine/Query/Sql/NativeSQLQueryJoinReturn.cs |
| ||||
using System;
using System.Collections.Generic;
namespace NHibernate.Engine.Query.Sql
{
/// <summary>
/// Represents a return defined as part of a native sql query which
/// names a collection role in the form {classname}.{collectionrole}; it
/// is used in defining a custom sql query for loading an entity's
/// collection in non-fetching scenarios (i.e., loading the collection
/// itself as the "root" of the result).
/// </summary>
[Serializable]
public class NativeSQLQueryCollectionReturn : NativeSQLQueryNonScalarReturn
{
private readonly string ownerEntityName;
private readonly string ownerProperty;
/// <summary> Construct a native-sql return representing a collection initializer </summary>
/// <param name="alias">The result alias </param>
/// <param name="ownerEntityName">
/// The entity-name of the entity owning the collection to be initialized.
/// </param>
/// <param name="ownerProperty">
/// The property name (on the owner) which represents
/// the collection to be initialized.
/// </param>
/// <param name="propertyResults">Any user-supplied column->property mappings </param>
/// <param name="lockMode">The lock mode to apply to the collection. </param>
public NativeSQLQueryCollectionReturn(string alias, string ownerEntityName, string ownerProperty, IDictionary<string, string[]> propertyResults, LockMode lockMode)
: base(alias, propertyResults, lockMode)
{
this.ownerEntityName = ownerEntityName;
this.ownerProperty = ownerProperty;
}
/// <summary>
/// The class owning the collection.
/// </summary>
public string OwnerEntityName
{
get { return ownerEntityName;
}
}
/// <summary>
/// The name of the property representing the collection from the <see cref="OwnerEntityName"/>.
/// </summary>
public string OwnerProperty
{
get { return ownerProperty;
}
}
}
}
|
| ||||
using System;
using System.Collections.Generic;
namespace NHibernate.Engine.Query.Sql
{
/// <summary>
/// Represents a return defined as part of a native sql query which
/// names a fetched role.
/// </summary>
[Serializable]
public class NativeSQLQueryJoinReturn : NativeSQLQueryNonScalarReturn
{
private readonly string ownerAlias;
private readonly string ownerProperty;
/// <summary> Construct a return descriptor representing some form of fetch. </summary>
/// <param name="alias">The result alias </param>
/// <param name="ownerAlias">The owner's result alias </param>
/// <param name="ownerProperty">The owner's property representing the thing to be fetched </param>
/// <param name="propertyResults">Any user-supplied column->property mappings </param>
/// <param name="lockMode">The lock mode to apply </param>
public NativeSQLQueryJoinReturn(string alias, string ownerAlias, string ownerProperty, IDictionary<string, string[]> propertyResults, LockMode lockMode)
: base(alias, propertyResults, lockMode)
{
this.ownerAlias = ownerAlias;
this.ownerProperty = ownerProperty;
}
/// <summary> The alias of the owner of this fetched association. </summary>
public string OwnerAlias
{
get { return ownerAlias;
}
}
/// <summary>
/// Retrieve the property name (relative to the owner) which maps to
/// the association to be fetched.
/// </summary>
public string OwnerProperty
{
get { return ownerProperty;
}
}
}
}
|
| |||
using System;
using System.Collections.Generic;
namespace NHibernate.Engine.Query.Sql
{
/// <summary>
/// Represents a return defined as part of a native sql query which
/// names a collection role in the form {classname}.{collectionrole}; it
/// is used in defining a custom sql query for loading an entity's
/// collection in non-fetching scenarios (i.e., loading the collection
/// itself as the "root" of the result).
/// names a fetched role.
/// </summary>
[Serializable]
public class [[#variable4b210040]]: NativeSQLQueryNonScalarReturn
{
private readonly string [[#variable522a5fa0]];
private readonly string ownerProperty;
/// <summary> Construct a native-sql return representing a collection initializer </summary>
/// <summary> Construct a return descriptor representing some form of fetch. </summary>
/// <param name="alias">The result alias </param>
/// <param name="ownerEntityName">
/// The entity-name of the entity owning the collection to be initialized.
/// </param>
/// <param name="ownerProperty">
/// The property name (on the owner) which represents
/// the collection to be initialized.
/// </param>
/// <param name="ownerAlias">The owner's result alias </param>
/// <param name="ownerProperty">The owner's property representing the thing to be fetched </param>
/// <param name="propertyResults">Any user-supplied column->property mappings </param>
/// <param name="lockMode">The lock mode to apply to the collection. </param>
/// <param name="lockMode">The lock mode to apply </param>
public [[#variable4b210040]](string alias, string [[#variable522a5fa0]], string ownerProperty, IDictionary<string, string[]> propertyResults, LockMode lockMode): base(alias, propertyResults, lockMode)
{
this. [[#variable522a5fa0]]= [[#variable522a5fa0]];
this.ownerProperty = ownerProperty;
}
/// <summary>
/// The class owning the collection.
/// </summary>
/// <summary> The alias of the owner of this fetched association. </summary>
public string [[#variable522a5ea0]]
{
get
{
return [[#variable522a5fa0]];
}
}
/// <summary>
/// The name of the property representing the collection from the <see cref="OwnerEntityName"/>.
/// Retrieve the property name (relative to the owner) which maps to
/// the association to be fetched.
/// </summary>
public string OwnerProperty
{
get
{
return ownerProperty;
}
}
}
}
|
| CloneAbstraction |
| Parameter Index | Clone Instance | Parameter Name | Value |
|---|---|---|---|
| 1 | 1 | [[#4b210040]] | NativeSQLQueryCollectionReturn |
| 1 | 2 | [[#4b210040]] | NativeSQLQueryJoinReturn |
| 2 | 1 | [[#522a5fa0]] | ownerEntityName |
| 2 | 2 | [[#522a5fa0]] | ownerAlias |
| 3 | 1 | [[#522a5ea0]] | OwnerEntityName |
| 3 | 2 | [[#522a5ea0]] | OwnerAlias |