Skip to content

NH-3609 - Fix using Projections.Conditional inside of Projections.Count #261

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from

Conversation

braahyan
Copy link
Contributor

@braahyan braahyan commented Apr 2, 2014

Hey guys,

Found this issue last week, managed to fix it with a fairly straightforward change. It affects back to at least 3.3.2.4000 . Let me know if I need to enhance the test case, but I think it illustrates the issue fairly clearly.

}

public virtual SqlString ToGroupSqlString(ICriteria criteria, ICriteriaQuery criteriaQuery, IDictionary<string, IFilter> enabledFilters)
{
return SqlStringHelper.RemoveAsAliasesFromSql(this.projection.ToSqlString(criteria, 0, criteriaQuery, enabledFilters));
var thinger = SqlStringHelper.RemoveAsAliasesFromSql(this.projection.ToSqlString(criteria, 0, criteriaQuery, enabledFilters));
return thinger;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please revert changes to this file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure thing, I'm kinda new to git, is there a way for me to edit the
history, or should I do some rollback and re apply my changes to a new
commit?
On Apr 2, 2014 6:26 PM, "Alexander I. Zaytsev" [email protected]
wrote:

In src/NHibernate/Criterion/GroupedProjection.cs:

    }

    public virtual SqlString ToGroupSqlString(ICriteria criteria, ICriteriaQuery criteriaQuery, IDictionary<string, IFilter> enabledFilters)
    {
  •       return SqlStringHelper.RemoveAsAliasesFromSql(this.projection.ToSqlString(criteria, 0, criteriaQuery, enabledFilters));
    
  •        var thinger = SqlStringHelper.RemoveAsAliasesFromSql(this.projection.ToSqlString(criteria, 0, criteriaQuery, enabledFilters));
    
  •       return thinger;
    }
    

Can you please revert changes to this file?

Reply to this email directly or view it on GitHubhttps://github.com//pull/261/files#r11231364
.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could use GitHub for Windows.
Should make this very easy as it's an User Interface.
https://windows.github.com/ https://windows.github.com/

2014-04-03 0:45 GMT+02:00 braahyan [email protected]:

In src/NHibernate/Criterion/GroupedProjection.cs:

    }

    public virtual SqlString ToGroupSqlString(ICriteria criteria, ICriteriaQuery criteriaQuery, IDictionary<string, IFilter> enabledFilters)
    {
  •       return SqlStringHelper.RemoveAsAliasesFromSql(this.projection.ToSqlString(criteria, 0, criteriaQuery, enabledFilters));
    
  •        var thinger = SqlStringHelper.RemoveAsAliasesFromSql(this.projection.ToSqlString(criteria, 0, criteriaQuery, enabledFilters));
    
  •       return thinger;
    }
    

Sure thing, I'm kinda new to git, is there a way for me to edit the
history, or should I do some rollback and re apply my changes to a new
commit?
... <#145249e95339a3c7_>
On Apr 2, 2014 6:26 PM, "Alexander I. Zaytsev" [email protected]
wrote: In src/NHibernate/Criterion/GroupedProjection.cs: > } > > public
virtual SqlString ToGroupSqlString(ICriteria criteria, ICriteriaQuery
criteriaQuery, IDictionary<string, IFilter> enabledFilters) > { > - return
SqlStringHelper.RemoveAsAliasesFromSql(this.projection.ToSqlString(criteria,
0, criteriaQuery, enabledFilters)); > + var thinger =
SqlStringHelper.RemoveAsAliasesFromSql(this.projection.ToSqlString(criteria,
0, criteriaQuery, enabledFilters)); > + return thinger; > } Can you please
revert changes to this file? -- Reply to this email directly or view it on
GitHub<
https://github.com/nhibernate/nhibernate-core/pull/261/files#r11231364> .

Reply to this email directly or view it on GitHubhttps://github.com//pull/261/files#r11232017
.

@braahyan
Copy link
Contributor Author

braahyan commented Apr 3, 2014

I have just pushed up a changeset to revert that file to the previous version. Let me know if I did the right thing. There's also a changeset around allowing parameters to be used in a GroupedProjection, should I start a new issue in JIRA and then put the test I wrote in a folder corresponding to that issue, or is there a better way for me to do that, or is how it is right now ok?

@braahyan
Copy link
Contributor Author

braahyan commented Apr 9, 2014

What's the status on this?

@braahyan
Copy link
Contributor Author

braahyan commented Jul 7, 2014

Is there something else that I need to do to get this code into NHibernate?

@hazzik hazzik added this to the 4.1.0 milestone Sep 21, 2014
@hazzik hazzik changed the title Fixes issue NH3609 NH-3609 - Fix using Projections.Conditional inside of Projections.Count Nov 18, 2014
Projections.Constant("", NHibernateUtil.String),
Projections.Constant(null, NHibernateUtil.String))).WithAlias(() => mappingEntity.Count))
)
.TransformUsing(Transformers.AliasToBean<MappingEntity>()).List<MappingEntity>()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you check something here?

@braahyan
Copy link
Contributor Author

what's the issue?

@hazzik hazzik closed this in bc9939b Sep 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants