Hibernate version: 3.0.5
Name and version of the database you are using:SQL Server 2000
I'm trying to use a subselect in a filter, but the problem I have is that the main table and a table in the subselect have a column with the same name. SQL Server uses the subselect table for that column, but I need the main table column used. That's easy enough using aliases, but within a filter I don't know the alias of the main table that Hibernate generates. Can this be made available with a placeholder, like ${this} or something? That way I could have a filter like this:
<filter name='x' condition="EXISTS (SELECT * FROM sub WHERE sub.name = ${this}.name)" />
Hibernate would just need to replace that with the alias generated for the main table. And no, SQL Server doesn't allow a full table name to be used when that table has an alias assigned.
|