Skip to content

Commit

Permalink
Cleaned up some custom SQL code
Browse files Browse the repository at this point in the history
  • Loading branch information
ggeurts committed Oct 17, 2012
1 parent 69cd430 commit 71a4165
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/NHibernate/Loader/Custom/Sql/SQLCustomQuery.cs
Expand Up @@ -21,7 +21,7 @@ public class SQLCustomQuery : ICustomQuery
private readonly List<IReturn> customQueryReturns = new List<IReturn>();
private readonly ISet<string> querySpaces = new HashedSet<string>();
private readonly SqlString sql;
private List<IParameterSpecification> parametersSpecifications;
private readonly List<IParameterSpecification> parametersSpecifications;

public SQLCustomQuery(INativeSQLQueryReturn[] queryReturns, string sqlQuery, ICollection<string> additionalQuerySpaces,
ISessionFactoryImplementor factory)
Expand Down
17 changes: 5 additions & 12 deletions src/NHibernate/Loader/Custom/Sql/SQLQueryReturnProcessor.cs
Expand Up @@ -103,14 +103,7 @@ public string GetOwnerAlias(string alias)
private IDictionary<string, string[]> InternalGetPropertyResultsMap(string alias)
{
NativeSQLQueryNonScalarReturn rtn = alias2Return[alias] as NativeSQLQueryNonScalarReturn;
if (rtn != null)
{
return rtn.PropertyResultsMap;
}
else
{
return null;
}
return rtn != null ? rtn.PropertyResultsMap : null;
}

private bool HasPropertyResultMap(string alias)
Expand All @@ -125,13 +118,13 @@ public ResultAliasContext Process()
// so that role returns can be more easily resolved to their owners
for (int i = 0; i < queryReturns.Length; i++)
{
if (queryReturns[i] is NativeSQLQueryNonScalarReturn)
var rtn = queryReturns[i] as NativeSQLQueryNonScalarReturn;
if (rtn != null)
{
NativeSQLQueryNonScalarReturn rtn = (NativeSQLQueryNonScalarReturn) queryReturns[i];
alias2Return[rtn.Alias] = rtn;
if (rtn is NativeSQLQueryJoinReturn)
var roleReturn = queryReturns[i] as NativeSQLQueryJoinReturn;
if (roleReturn != null)
{
NativeSQLQueryJoinReturn roleReturn = (NativeSQLQueryJoinReturn) queryReturns[i];
alias2OwnerAlias[roleReturn.Alias] = roleReturn.OwnerAlias;
}
}
Expand Down

0 comments on commit 71a4165

Please sign in to comment.