Skip to content

NH-2951 - Missing alias in hql update (select) statement with joined subclasses #1015

Closed
@nhibernate-bot

Description

@nhibernate-bot

Patrick Earl created an issue — 21st November 2011, 23:29:06:

QbCustomer inherits from QbEntity and both tables have the Id field.

HQL is:

update QbInvoice i set i.Customer = (select c from QbCustomer c where c.QbId = ?) where i.QbId = ?

In the generated query, the "Id" field is missing the alias and is ambiguous.

update "QbInvoice" set "CustomerId"=
(select "Id"
 from "QbCustomer" qbcustomer1_
 inner join "QbEntity" qbcustomer1_1_ on qbcustomer1_."Id"=qbcustomer1_1_."Id"
 where qbcustomer1_1_."QbId"=?) where "QbId"=?

Patrick Earl added a comment — 22nd November 2011, 0:26:10:

Using (select c.Id ...) is a workaround for this problem. A failing test has been committed.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions