[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-6116) Envers AuditEntity.revisionProperty("...").isNotNull() creates wrong sql
Uli Steinkopf (JIRA)
noreply at atlassian.com
Tue Apr 12 14:03:59 EDT 2011
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-6116?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=42015#action_42015 ]
Uli Steinkopf commented on HHH-6116:
------------------------------------
Seems that the Problem is not the creation of sql itself rather than the hql before.....
org.hibernate.envers.query.criteria.NotNullAuditExpression
...
public void addToQuery(AuditConfiguration auditCfg, String entityName, QueryBuilder qb, Parameters parameters) {
String propertyName = propertyNameGetter.get(auditCfg);
RelationDescription relatedEntity = CriteriaTools.getRelatedEntity(auditCfg, entityName, propertyName);
if (relatedEntity == null) {
parameters.addWhereWithParam(propertyName, "<>", null); // !!!!!!this is the problem
} else {
relatedEntity.getIdMapper().addIdEqualsToQuery(parameters, null, propertyName, false);
}
}
So incorrect HQL is created.....
> Envers AuditEntity.revisionProperty("...").isNotNull() creates wrong sql
> ------------------------------------------------------------------------
>
> Key: HHH-6116
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6116
> Project: Hibernate Core
> Issue Type: Bug
> Components: envers
> Affects Versions: 3.6.0, 3.6.1, 3.6.2, 3.6.3
> Environment: hibernate 3.6.1 , oracle 10g...
> hibernate 3.6.3 , oracle 10g...
> Reporter: Uli Steinkopf
>
> Hello...
> AuditEntity.revisionProperty("..").isNotNull() create sql in the form of
> column_name <> null
> instead of
> column_name is not null
> like the sql standard
> says. E.g oracle handles "<>" different than "is not", so actual version is in this env usesless...
--
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.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list