Skip to content

NH-2926 - CriteriaQuery - Unable to sort by composite-id #1103

Closed
@nhibernate-bot

Description

@nhibernate-bot

stanislav merovic created an issue — 2nd November 2011, 6:42:53:

When trying to add a order for a composite-id using criteria queries the alias is removed only for the last property and a invalid query is created.

Cause: Order.ToSqlString -> NHibernate.Util.StringHelper.RemoveAsAliasesFromSql(produced); -> sql.Substring(0, sql.LastIndexOfCaseInsensitive(" as "));


stanislav merovic added a comment — 2nd November 2011, 7:08:28:

Forgot to mention: This happens when using the identifier projection.

crit.AddOrder(Order.Asc(Projections.Id))

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions