DELETE Query generating invalid SQL for PostgreSQL databases.
-------------------------------------------------------------
Key: HHH-7314
URL: https://hibernate.onjira.com/browse/HHH-7314
Project: Hibernate ORM
Issue Type: Bug
Components: core, entity-manager
Affects Versions: 4.1.3, 4.1.2
Environment: Hibernate 4.1.2, 4.1.3, PostgreSQL 9.1 (should effect all releases from 8.1 ~ current)
Reporter: Bryan Varner
Using a JPA Delete query with conditions requiring a join through Hibernate entity-manager generates invalid SQL for PostgreSQL.
PostgreSQL cannot use CROSS JOIN in the FROM clause of a DELETE query.
For example: JPQL Query
{code}
DELETE FROM Foo f WHERE f.bar.key = :key AND f.anotherprop = :anotherval
{code}
Generates an (invalid) SQL query like:
{code}
delete from schema.Foo cross join schema.Bar bar1_ where key=$1 and anotherprop=$2
{code}
For PostgreSQL I believe this needs to look like:
{code}
delete from schema.Foo using schema.Bar bar1_ where key=$1 and anotherprop=$2
{code}
PostgreSQL documentation on the DELETE syntax:
http://www.postgresql.org/docs/8.1/static/sql-delete.htmlhttp://www.postgresql.org/docs/9.1/static/sql-delete.html
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
DetachedCriteria: get sql alias used for sql projection or sql restriction
--------------------------------------------------------------------------
Key: HHH-6353
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6353
Project: Hibernate Core
Issue Type: Improvement
Components: query-criteria
Environment: Java 6, Jboss 5.1.0, Hibernate 3
Reporter: Dave
A method to get sql alias is needed from DetachedCriteria in order to use
non-root entity alias in sql restriction or sql projection.
DetachedCriteria:
String getSqlAlias(String alias) // alias has been created
detachedCriteria.createAlias("group","g");
String sqlAlias = detachedCriteria.getSqlAlias("g");
detachedCriteria.add(Restrictions.sqlRestriction(sqlAlias + ".name='John'"));
detachedCriteria.setProjection(Restrictions.sqlProjection(sqlAlias + ".name"));
--
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
Locks to manage IndexWriter instances should not prevent a concurrent get and a commit operation
------------------------------------------------------------------------------------------------
Key: HSEARCH-852
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-852
Project: Hibernate Search
Issue Type: Improvement
Reporter: Sanne Grinovero
Assignee: Sanne Grinovero
Fix For: 4.0.0.Alpha2
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira