[Hibernate-JIRA] Resolved: (HHH-1480) JOIN precendence rules per SQL-99
by Steve Ebersole (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1480?page=c... ]
Steve Ebersole resolved HHH-1480.
---------------------------------
Resolution: Fixed
Fix Version/s: (was: 3.3.x)
(was: 3.2.x)
Gonna resolve this, not close it. Please test it out. Thanks!
> JOIN precendence rules per SQL-99
> ---------------------------------
>
> Key: HHH-1480
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1480
> Project: Hibernate Core
> Issue Type: New Feature
> Components: query-hql
> Affects Versions: 3.1.2
> Reporter: trebor iksrazal
> Assignee: Steve Ebersole
> Fix For: 3.5
>
>
> In SQL-92 joins performed in the where clause (comma operator in from clause) and joins performed in the from clause (join keyword) had the same precedence. SQL-99 clarified this such that the from clause joins had higher precedence.
> Hibernate currently treats these as having the same precedence.
> A good explanation comes from the MySQL docs ( http://dev.mysql.com/doc/refman/5.0/en/join.html ) :
> #
> Previously, the comma operator (,) and JOIN both had the same precedence, so the join expression t1, t2 JOIN t3 was interpreted as ((t1, t2) JOIN t3). Now JOIN has higher precedence, so the expression is interpreted as (t1, (t2 JOIN t3)). This change affects statements that use an ON clause, because that clause can refer only to columns in the operands of the join, and the change in precedence changes interpretation of what those operands are.
> Example:
> CREATE TABLE t1 (i1 INT, j1 INT);
> CREATE TABLE t2 (i2 INT, j2 INT);
> CREATE TABLE t3 (i3 INT, j3 INT);
> INSERT INTO t1 VALUES(1,1);
> INSERT INTO t2 VALUES(1,1);
> INSERT INTO t3 VALUES(1,1);
> SELECT * FROM t1, t2 JOIN t3 ON (t1.i1 = t3.i3);
> Previously, the SELECT was legal due to the implicit grouping of t1,t2 as (t1,t2). Now the JOIN takes precedence, so the operands for the ON clause are t2 and t3. Because t1.i1 is not a column in either of the operands, the result is an Unknown column 't1.i1' in 'on clause' error. To allow the join to be processed, group the first two tables explicitly with parentheses so that the operands for the ON clause are (t1,t2) and t3:
> SELECT * FROM (t1, t2) JOIN t3 ON (t1.i1 = t3.i3);
> Alternatively, avoid the use of the comma operator and use JOIN instead:
> SELECT * FROM t1 JOIN t2 JOIN t3 ON (t1.i1 = t3.i3);
> This change also applies to statements that mix the comma operator with INNER JOIN, CROSS JOIN, LEFT JOIN, and RIGHT JOIN, all of which now have higher precedence than the comma operator.
--
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
15 years, 2 months
[Hibernate-JIRA] Commented: (HHH-1480) JOIN precendence rules per SQL-99
by Steve Ebersole (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1480?page=c... ]
Steve Ebersole commented on HHH-1480:
-------------------------------------
so basically i added this with a hook into the dialect that ask the dialect for its cross join separator. The default now returns " cross join ". As we find databases which do not support from-clause joins or do not support "A cross join B" specifically we can change their dialects.
> JOIN precendence rules per SQL-99
> ---------------------------------
>
> Key: HHH-1480
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1480
> Project: Hibernate Core
> Issue Type: New Feature
> Components: query-hql
> Affects Versions: 3.1.2
> Reporter: trebor iksrazal
> Assignee: Steve Ebersole
> Fix For: 3.2.x, 3.3.x, 3.5
>
>
> In SQL-92 joins performed in the where clause (comma operator in from clause) and joins performed in the from clause (join keyword) had the same precedence. SQL-99 clarified this such that the from clause joins had higher precedence.
> Hibernate currently treats these as having the same precedence.
> A good explanation comes from the MySQL docs ( http://dev.mysql.com/doc/refman/5.0/en/join.html ) :
> #
> Previously, the comma operator (,) and JOIN both had the same precedence, so the join expression t1, t2 JOIN t3 was interpreted as ((t1, t2) JOIN t3). Now JOIN has higher precedence, so the expression is interpreted as (t1, (t2 JOIN t3)). This change affects statements that use an ON clause, because that clause can refer only to columns in the operands of the join, and the change in precedence changes interpretation of what those operands are.
> Example:
> CREATE TABLE t1 (i1 INT, j1 INT);
> CREATE TABLE t2 (i2 INT, j2 INT);
> CREATE TABLE t3 (i3 INT, j3 INT);
> INSERT INTO t1 VALUES(1,1);
> INSERT INTO t2 VALUES(1,1);
> INSERT INTO t3 VALUES(1,1);
> SELECT * FROM t1, t2 JOIN t3 ON (t1.i1 = t3.i3);
> Previously, the SELECT was legal due to the implicit grouping of t1,t2 as (t1,t2). Now the JOIN takes precedence, so the operands for the ON clause are t2 and t3. Because t1.i1 is not a column in either of the operands, the result is an Unknown column 't1.i1' in 'on clause' error. To allow the join to be processed, group the first two tables explicitly with parentheses so that the operands for the ON clause are (t1,t2) and t3:
> SELECT * FROM (t1, t2) JOIN t3 ON (t1.i1 = t3.i3);
> Alternatively, avoid the use of the comma operator and use JOIN instead:
> SELECT * FROM t1 JOIN t2 JOIN t3 ON (t1.i1 = t3.i3);
> This change also applies to statements that mix the comma operator with INNER JOIN, CROSS JOIN, LEFT JOIN, and RIGHT JOIN, all of which now have higher precedence than the comma operator.
--
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
15 years, 2 months
[Hibernate-JIRA] Commented: (HHH-1480) JOIN precendence rules per SQL-99
by Steve Ebersole (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1480?page=c... ]
Steve Ebersole commented on HHH-1480:
-------------------------------------
uhhh, hql and jpaql are the same (basic) thing and are processed by the same piece of code :)
> JOIN precendence rules per SQL-99
> ---------------------------------
>
> Key: HHH-1480
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1480
> Project: Hibernate Core
> Issue Type: New Feature
> Components: query-hql
> Affects Versions: 3.1.2
> Reporter: trebor iksrazal
> Assignee: Steve Ebersole
> Fix For: 3.2.x, 3.3.x, 3.5
>
>
> In SQL-92 joins performed in the where clause (comma operator in from clause) and joins performed in the from clause (join keyword) had the same precedence. SQL-99 clarified this such that the from clause joins had higher precedence.
> Hibernate currently treats these as having the same precedence.
> A good explanation comes from the MySQL docs ( http://dev.mysql.com/doc/refman/5.0/en/join.html ) :
> #
> Previously, the comma operator (,) and JOIN both had the same precedence, so the join expression t1, t2 JOIN t3 was interpreted as ((t1, t2) JOIN t3). Now JOIN has higher precedence, so the expression is interpreted as (t1, (t2 JOIN t3)). This change affects statements that use an ON clause, because that clause can refer only to columns in the operands of the join, and the change in precedence changes interpretation of what those operands are.
> Example:
> CREATE TABLE t1 (i1 INT, j1 INT);
> CREATE TABLE t2 (i2 INT, j2 INT);
> CREATE TABLE t3 (i3 INT, j3 INT);
> INSERT INTO t1 VALUES(1,1);
> INSERT INTO t2 VALUES(1,1);
> INSERT INTO t3 VALUES(1,1);
> SELECT * FROM t1, t2 JOIN t3 ON (t1.i1 = t3.i3);
> Previously, the SELECT was legal due to the implicit grouping of t1,t2 as (t1,t2). Now the JOIN takes precedence, so the operands for the ON clause are t2 and t3. Because t1.i1 is not a column in either of the operands, the result is an Unknown column 't1.i1' in 'on clause' error. To allow the join to be processed, group the first two tables explicitly with parentheses so that the operands for the ON clause are (t1,t2) and t3:
> SELECT * FROM (t1, t2) JOIN t3 ON (t1.i1 = t3.i3);
> Alternatively, avoid the use of the comma operator and use JOIN instead:
> SELECT * FROM t1 JOIN t2 JOIN t3 ON (t1.i1 = t3.i3);
> This change also applies to statements that mix the comma operator with INNER JOIN, CROSS JOIN, LEFT JOIN, and RIGHT JOIN, all of which now have higher precedence than the comma operator.
--
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
15 years, 2 months
[Hibernate-JIRA] Closed: (HHH-1012) Index not created by SchemaUpdate
by Steve Ebersole (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1012?page=c... ]
Steve Ebersole closed HHH-1012.
-------------------------------
Resolution: Fixed
> Index not created by SchemaUpdate
> ---------------------------------
>
> Key: HHH-1012
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1012
> Project: Hibernate Core
> Issue Type: New Feature
> Components: metamodel
> Affects Versions: 3.2.5
> Environment: Windows XP, MySQL/PostgreSQL
> Reporter: Xavier Farret
> Assignee: Steve Ebersole
> Priority: Minor
> Fix For: 3.2.x, 3.3.x, 3.5
>
> Attachments: Indexes.patch
>
>
> i'm using an hbm.xml as describe below and the 'hibernate.hbm2ddl.auto' is egal to update.
> <class table="featurestat" name=".....">
> <id name="id" type="long" column="idFeatureStat">
> <generator class="increment"/>
> </id>
> <properties name="fsUniqueValue" unique="true">
> ....
> </properties>
> <property name="frequency" .../>
> <property name="idFatherFeature" index="FeatStatDocExtSectFeat" not-null="true" type="long" column="..."/>
> ....
> </class>
> Indexes for pk or unique key are well created, but the index explicity named 'FeatStatDocExtSectFeat' is never created. If i put the property 'hibernate.hbm2ddl.auto' in the cfg.xml as 'create' the index is created. But in my case i have to set my property 'hibernate.hbm2ddl.auto' to update.
--
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
15 years, 2 months
[Hibernate-JIRA] Created: (ANN-594) Filters for MappedSuperClass
by Shawn Clowater (JIRA)
Filters for MappedSuperClass
----------------------------
Key: ANN-594
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-594
Project: Hibernate Annotations
Issue Type: New Feature
Components: binder
Affects Versions: 3.3.0.ga
Reporter: Shawn Clowater
Priority: Minor
Based on discussion from
http://forum.hibernate.org/viewtopic.php?t=963539&start=0
Essentially, it would be nice to be able to define filters on a MappedSuperClass and have them 'trickle down' to the subclasses. (at the class level - not sure if property level filters are carried down right now).
I see the MappedSuperClass as a means to define generic behaviour (common columns, etc) and I think it makes sense for the filters to play nicely as well.
In addition, I don' t know if it is already a separate JIRA request, filters off of an Interface would be fantastic as well as our application is using filters heavily and are always looking at ways to reduce the amount of filter annotations that we have to spread around.
Right now, we're either forced to copy filter annotations all over the place OR we've actually been a bit sneaky and have tapped into custom persisters to dynamically apply common filters. However, there is a separate issue based on the order that entity persisters are built.
--
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
15 years, 2 months