[Hibernate-JIRA] Commented: (HHH-530) Allow application of filters on subqueries
by Shawn Clowater (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-530?page=co... ]
Shawn Clowater commented on HHH-530:
------------------------------------
What's HQL? ;)
Bleh, I actually thought it was working on the HQL already (we are primarily Criteria). From my initial pass trying to see what is disabling them in HQL it would appear that it might only be the following that would need to change....
In JoinProcessor there's a snippet
{code}
// Generate FROM and WHERE fragments for the from element.
JoinFragment joinFragment = join.toJoinFragment(
inSubquery ? Collections.EMPTY_MAP : queryTranslatorImpl.getEnabledFilters(),
fromElement.useFromFragment() || fromElement.isDereferencedBySuperclassOrSubclassProperty(),
fromElement.getWithClauseFragment(),
fromElement.getWithClauseJoinAlias()
);
{code}
{code}
Which i think should just be
// Generate FROM and WHERE fragments for the from element.
JoinFragment joinFragment = join.toJoinFragment(
queryTranslatorImpl.getEnabledFilters(),
fromElement.useFromFragment() || fromElement.isDereferencedBySuperclassOrSubclassProperty(),
fromElement.getWithClauseFragment(),
fromElement.getWithClauseJoinAlias()
);
{code}
Of course if it works then the whole inSubquery thing should be peeled back.
The only other suspect code I see would be in the token(String token, QueryTranslatorImpl q) method of WhereParser but it might be fine (aka I'm not sure exactly what it's doing)
> Allow application of filters on subqueries
> ------------------------------------------
>
> Key: HHH-530
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-530
> Project: Hibernate Core
> Issue Type: Patch
> Components: core
> Reporter: Gavin King
> Assignee: Steve Ebersole
> Fix For: 3.3.x
>
> Attachments: HHH-530.3.3.SP1.patch, HHH-530.Additional.Subquery.patch, HHH-530.patch, hibernate_filter_fix-3.0.5.patch, hibernate_filter_fix-3.0.5_14.patch, SubqueriesWithFiltersTest.patch
>
>
> Currently filter conditions are applied in subselects, they should not be.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 4 months
[Hibernate-JIRA] Created: (HHH-3479) NPE in ForeignKey
by Thomas Diesler (JIRA)
NPE in ForeignKey
-----------------
Key: HHH-3479
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3479
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.2.6
Reporter: Thomas Diesler
java.lang.NullPointerException
at org.hibernate.mapping.ForeignKey.isPhysicalConstraint(ForeignKey.java:125)
at org.jbpm.db.JbpmSchema.getCleanSql(JbpmSchema.java:132)
at org.jbpm.db.JbpmSchema.cleanSchema(JbpmSchema.java:214)
at org.jbpm.persistence.db.DbPersistenceServiceFactory.cleanSchema(DbPersistenceServiceFactory.java:123)
public boolean isPhysicalConstraint() {
return referencedTable.isPhysicalTable() &&
getTable().isPhysicalTable() &&
!referencedTable.hasDenormalizedTables();
}
This NPE occurs when the referencedTable is null.
There are several methods that assume that that the referencedTable is not null.
The referencedEntityName however is not null in my use case.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 4 months