Previous CloneSet | Next CloneSet | Back to Main Report |
Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
---|---|---|---|---|
26 | 2 | 1 | 0.986 | statement_list[7] |
Clone Abstraction | Parameter Bindings |
Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
---|---|---|---|
1 | 26 | 449 | src/NHibernate/Impl/AbstractDetachedQuery.cs |
2 | 26 | 548 | src/NHibernate/Impl/AbstractDetachedQuery.cs |
| ||||
// Even if the probably that somebody use a mixed technique to set parameters // (from POCO using SetProperties and using named parameter setters) here is a possible // difference between IQuery and DetachedQuery behaviour. // In IQuery we don't know who override a param value; in DetachedQuery the direct use of // a named parameter setter override the param value set by SetProperties(POCO) foreach (object obj in optionalUntypeParams) q.SetProperties(obj); // Set untyped positional parameters foreach (KeyValuePair<int, object> pup in posUntypeParams) q.SetParameter(pup.Key, pup.Value); // Set untyped named parameters foreach (KeyValuePair<string, object> nup in namedUntypeParams) q.SetParameter(nup.Key, nup.Value); // Set untyped named parameters list foreach (KeyValuePair<string, ICollection> nulp in namedUntypeListParams) q.SetParameterList(nulp.Key, nulp.Value); // Set typed positional parameters foreach (KeyValuePair<int, TypedValue> pp in posParams) q.SetParameter(pp.Key, pp.Value.Value, pp.Value.Type); // Set typed named parameters foreach (KeyValuePair<string, TypedValue> np in namedParams) q.SetParameter(np.Key, np.Value.Value, np.Value.Type); // Set typed named parameters List foreach (KeyValuePair<string, TypedValue> nlp in namedListParams) q.SetParameterList(nlp.Key, (ICollection)nlp.Value.Value, nlp.Value.Type); |
| ||||
foreach (object obj in optionalUntypeParams) destination.SetProperties(obj); // Set untyped positional parameters foreach (KeyValuePair<int, object> pup in posUntypeParams) destination.SetParameter(pup.Key, pup.Value); // Set untyped named parameters foreach (KeyValuePair<string, object> nup in namedUntypeParams) destination.SetParameter(nup.Key, nup.Value); // Set untyped named parameters list foreach (KeyValuePair<string, ICollection> nulp in namedUntypeListParams) destination.SetParameterList(nulp.Key, nulp.Value); // Set typed positional parameters foreach (KeyValuePair<int, TypedValue> pp in posParams) destination.SetParameter(pp.Key, pp.Value.Value, pp.Value.Type); // Set typed named parameters foreach (KeyValuePair<string, TypedValue> np in namedParams) destination.SetParameter(np.Key, np.Value.Value, np.Value.Type); // Set typed named parameters List foreach (KeyValuePair<string, TypedValue> nlp in namedListParams) destination.SetParameterList(nlp.Key, (ICollection)nlp.Value.Value, nlp.Value.Type); |
| |||
// Even if the probably that somebody use a mixed technique to set parameters // (from POCO using SetProperties and using named parameter setters) here is a possible // difference between IQuery and DetachedQuery behaviour. // In IQuery we don't know who override a param value; in DetachedQuery the direct use of // a named parameter setter override the param value set by SetProperties(POCO) foreach (object obj in optionalUntypeParams) [[#variable2a3a0cc0]].SetProperties(obj); // Set untyped positional parameters foreach (KeyValuePair<int, object> pup in posUntypeParams) [[#variable2a3a0cc0]].SetParameter(pup.Key, pup.Value); // Set untyped named parameters foreach (KeyValuePair<string, object> nup in namedUntypeParams) [[#variable2a3a0cc0]].SetParameter(nup.Key, nup.Value); // Set untyped named parameters list foreach (KeyValuePair<string, ICollection> nulp in namedUntypeListParams) [[#variable2a3a0cc0]].SetParameterList(nulp.Key, nulp.Value); // Set typed positional parameters foreach (KeyValuePair<int, TypedValue> pp in posParams) [[#variable2a3a0cc0]].SetParameter(pp.Key, pp.Value.Value, pp.Value.Type); // Set typed named parameters foreach (KeyValuePair<string, TypedValue> np in namedParams) [[#variable2a3a0cc0]].SetParameter(np.Key, np.Value.Value, np.Value.Type); // Set typed named parameters List foreach (KeyValuePair<string, TypedValue> nlp in namedListParams) [[#variable2a3a0cc0]].SetParameterList(nlp.Key, (ICollection)nlp.Value.Value, nlp.Value.Type); |
CloneAbstraction |
Parameter Index | Clone Instance | Parameter Name | Value |
---|---|---|---|
1 | 1 | [[#2a3a0cc0]] | q |
1 | 2 | [[#2a3a0cc0]] | destination |