[Hibernate-JIRA] Updated: (HHH-1780) negation of EXISTS in hql query does not work
by Igor Vaynberg (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1780?page=c... ]
Igor Vaynberg updated HHH-1780:
-------------------------------
Attachment: hibernate-HHH-1780-fix.patch
attaching a working fix.
note: the sibling-relinking code should probably be pushed into basehqlparaser#invertnode
> negation of EXISTS in hql query does not work
> ---------------------------------------------
>
> Key: HHH-1780
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1780
> Project: Hibernate Core
> Issue Type: Bug
> Affects Versions: 3.1.3, 3.2.0 cr1, 3.2.0.cr2
> Reporter: Marton Papp
> Attachments: hibernate-HHH-1780-fix.patch, hibernate-HHH-1780-fix.patch, hibernate-HHH-1780-test.patch
>
>
> Hello!
> I think I found a bug in Hibernate, in class org.hibernate.hql.ast.HqlParser.
> It is in the methtod:
> public AST negateNode(AST x)
> The switch lacks the node type: EXISTS.
> The default negateNode() implementation in org.hibernate.hql.antlr.HqlBaseParser seems to be broken by me, since it does not actually inverts the node but returns a node that is inverted. Or, to be more exact, the negation of OR and AND types are buggy, since they seem to assume that negateNode() will change the node itself, and so they simply discard its return value.
> I wish the branch for NOT was not commented out, since it would provide a workaround, but now i'm stuck.
> Regards,
> Marton
--
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
14 years, 6 months
[Hibernate-JIRA] Commented: (HHH-1780) negation of EXISTS in hql query does not work
by Igor Vaynberg (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1780?page=c... ]
Igor Vaynberg commented on HHH-1780:
------------------------------------
the fix is not quiet there yet, needs a bit more work...
> negation of EXISTS in hql query does not work
> ---------------------------------------------
>
> Key: HHH-1780
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1780
> Project: Hibernate Core
> Issue Type: Bug
> Affects Versions: 3.1.3, 3.2.0 cr1, 3.2.0.cr2
> Reporter: Marton Papp
> Attachments: hibernate-HHH-1780-fix.patch, hibernate-HHH-1780-test.patch
>
>
> Hello!
> I think I found a bug in Hibernate, in class org.hibernate.hql.ast.HqlParser.
> It is in the methtod:
> public AST negateNode(AST x)
> The switch lacks the node type: EXISTS.
> The default negateNode() implementation in org.hibernate.hql.antlr.HqlBaseParser seems to be broken by me, since it does not actually inverts the node but returns a node that is inverted. Or, to be more exact, the negation of OR and AND types are buggy, since they seem to assume that negateNode() will change the node itself, and so they simply discard its return value.
> I wish the branch for NOT was not commented out, since it would provide a workaround, but now i'm stuck.
> Regards,
> Marton
--
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
14 years, 6 months
[Hibernate-JIRA] Commented: (HHH-1088) IdentifierProjection does not work with composite keys
by David (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1088?page=c... ]
David commented on HHH-1088:
----------------------------
I came across this problem today. I have a composite key (legacy tables) but each row contains a lot of data and we are doing some paging. We execute a query and store the composite keys to the results in the user's session. Each page, we can grab the IDs from the session and load the data from the database for that page.
Would be nice to fix this but here was my fix for anyone else that comes across this:
Assuming your composite key has an id of "id"
ProjectionList projList = Projections.projectionList();
projList.add(Projections.property("id.col1"));
projList.add(Projections.property("id.col2"));
After the query...
while (results.next()) {
CompKeyId id = new CompKeyId (results.get(0), results.get(1));
}
> IdentifierProjection does not work with composite keys
> ------------------------------------------------------
>
> Key: HHH-1088
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1088
> Project: Hibernate Core
> Issue Type: Bug
> Components: query-criteria
> Affects Versions: 3.1 rc2
> Reporter: Max Muermann
> Attachments: CompositeIdProjection.java, CriteriaLoader.java
>
>
> When working with Criteria queries, the IdentifierProjection breaks if the entity has a composite key.
> In IdentifierProjection.java:
> public String toSqlString(Criteria criteria, int position, CriteriaQuery criteriaQuery)
> throws HibernateException {
> StringBuffer buf = new StringBuffer();
> String[] cols = criteriaQuery.getIdentifierColumns(criteria);
> for ( int i=0; i<cols.length; i++ ) {
> buf.append( cols[i] )
> .append(" as y")
> .append(position + i)
> .append('_');
> }
> return buf.toString();
> }
> This method does not add commas as separators between the column names. Easily fixed by adding
> if (i<col.length-1)
> buf.append(",");
> as the last statement inside the loop.
> However, this leads to another problem:
> the type returned by IdentifierProjection.geType is the (single) type of the composite id component. The query will however return the property values of the id component without a mapping step.
--
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
14 years, 6 months
[Hibernate-JIRA] Commented: (HHH-1780) negation of EXISTS in hql query does not work
by Igor Vaynberg (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1780?page=c... ]
Igor Vaynberg commented on HHH-1780:
------------------------------------
patches are against BRANCH_3_3
> negation of EXISTS in hql query does not work
> ---------------------------------------------
>
> Key: HHH-1780
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1780
> Project: Hibernate Core
> Issue Type: Bug
> Affects Versions: 3.1.3, 3.2.0 cr1, 3.2.0.cr2
> Reporter: Marton Papp
> Attachments: hibernate-HHH-1780-fix.patch, hibernate-HHH-1780-test.patch
>
>
> Hello!
> I think I found a bug in Hibernate, in class org.hibernate.hql.ast.HqlParser.
> It is in the methtod:
> public AST negateNode(AST x)
> The switch lacks the node type: EXISTS.
> The default negateNode() implementation in org.hibernate.hql.antlr.HqlBaseParser seems to be broken by me, since it does not actually inverts the node but returns a node that is inverted. Or, to be more exact, the negation of OR and AND types are buggy, since they seem to assume that negateNode() will change the node itself, and so they simply discard its return value.
> I wish the branch for NOT was not commented out, since it would provide a workaround, but now i'm stuck.
> Regards,
> Marton
--
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
14 years, 6 months
[Hibernate-JIRA] Updated: (HHH-1780) negation of EXISTS in hql query does not work
by Igor Vaynberg (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1780?page=c... ]
Igor Vaynberg updated HHH-1780:
-------------------------------
Attachment: hibernate-HHH-1780-fix.patch
hibernate-HHH-1780-test.patch
attached test case and fix
> negation of EXISTS in hql query does not work
> ---------------------------------------------
>
> Key: HHH-1780
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1780
> Project: Hibernate Core
> Issue Type: Bug
> Affects Versions: 3.1.3, 3.2.0 cr1, 3.2.0.cr2
> Reporter: Marton Papp
> Attachments: hibernate-HHH-1780-fix.patch, hibernate-HHH-1780-test.patch
>
>
> Hello!
> I think I found a bug in Hibernate, in class org.hibernate.hql.ast.HqlParser.
> It is in the methtod:
> public AST negateNode(AST x)
> The switch lacks the node type: EXISTS.
> The default negateNode() implementation in org.hibernate.hql.antlr.HqlBaseParser seems to be broken by me, since it does not actually inverts the node but returns a node that is inverted. Or, to be more exact, the negation of OR and AND types are buggy, since they seem to assume that negateNode() will change the node itself, and so they simply discard its return value.
> I wish the branch for NOT was not commented out, since it would provide a workaround, but now i'm stuck.
> Regards,
> Marton
--
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
14 years, 6 months
[Hibernate-JIRA] Commented: (HHH-1780) negation of EXISTS in hql query does not work
by Igor Vaynberg (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1780?page=c... ]
Igor Vaynberg commented on HHH-1780:
------------------------------------
just got hit by this, pretty nasty. you guys find any workarounds?
> negation of EXISTS in hql query does not work
> ---------------------------------------------
>
> Key: HHH-1780
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1780
> Project: Hibernate Core
> Issue Type: Bug
> Affects Versions: 3.1.3, 3.2.0 cr1, 3.2.0.cr2
> Reporter: Marton Papp
>
> Hello!
> I think I found a bug in Hibernate, in class org.hibernate.hql.ast.HqlParser.
> It is in the methtod:
> public AST negateNode(AST x)
> The switch lacks the node type: EXISTS.
> The default negateNode() implementation in org.hibernate.hql.antlr.HqlBaseParser seems to be broken by me, since it does not actually inverts the node but returns a node that is inverted. Or, to be more exact, the negation of OR and AND types are buggy, since they seem to assume that negateNode() will change the node itself, and so they simply discard its return value.
> I wish the branch for NOT was not commented out, since it would provide a workaround, but now i'm stuck.
> Regards,
> Marton
--
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
14 years, 6 months
[Hibernate-JIRA] Created: (HBX-936) Project cannot be deleted when there is console configuration associated with the project
by Dariusz Tylus (JIRA)
Project cannot be deleted when there is console configuration associated with the project
-----------------------------------------------------------------------------------------
Key: HBX-936
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-936
Project: Hibernate Tools
Issue Type: Bug
Components: consoleconfiguration, eclipse
Affects Versions: 3.2beta9
Environment: Eclipse 3.2, Windows XP, jdk1.5.0_8
Reporter: Dariusz Tylus
Project cannot be deleted when there is console configuration associated with the project:
Use case:
1. Create java project
2. Put jdbc driver jar file into lib filder (in the project)
3. Create console configuration for this project
4. Swich to the hibernate perspective and expand the tree for just created console configuration
5. Delete the console configuration
6. Delete the project and select option 'Also delete contents under....'
There is following error:
==
Problems encountered while deleting resources.
Could not delete: /hbmtest.
Problems encountered while deleting resources.
Problems encountered while deleting files.
Could not delete: C:\work\ORM\_tests\orm\hbmtest\lib\hsqldb-1_7_2_9.jar.
Could not delete: C:\work\ORM\_tests\orm\hbmtest\lib.
==
The problem is that jvm keeps lock on the jar file so it cannot be deleted.
Console configuration also keeps reference to the driver class.
Could the console configuration release all resources when it is deleted?
Thenx,
Dariusz
--
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
14 years, 6 months