[Hibernate-JIRA] Created: (HHH-2289) CLONE -Support new MySQL 5.0.12 join syntax
by Peter Lundberg (JIRA)
CLONE -Support new MySQL 5.0.12 join syntax
-------------------------------------------
Key: HHH-2289
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2289
Project: Hibernate3
Type: New Feature
Components: query-sql
Versions: 3.1.2
Reporter: Peter Lundberg
http://dev.mysql.com/doc/refman/5.0/en/join.html
"Beginning with MySQL 5.0.12, natural joins and joins with USING, including outer join variants, are processed according to the SQL:2003 standard. These changes make MySQL more compliant with standard SQL. However, they can result in different output columns for some joins. Also, some queries that appeared to work correctly in older versions must be rewritten to comply with the standard. The following list provides more detail about several effects of the 5.0.12 change in join processing. The term "previously" means "prior to MySQL 5.0.12."
Using 5.0.18 and hibernate 3.1.2, hibernate is not producing the correct join syntax for the latest versions of mysql.
For example:
FROM tableA AS A, tableB AS B INNER JOIN tableC AS C ON A.field1 =
C.field2
The above fails, because the B JOIN C is evaluated before the A alias has
been created.
The solution is to use parentheses to force an order of evaluation:
FROM (tableA AS A, tableB AS B) INNER JOIN tableC AS C ON A.field1 =
C.field2
--
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
17 years, 5 months
[Hibernate-JIRA] Commented: (HHH-1786) JTASessionContext.CleanupSynch does not remove sessions from currentSessionMap
by Reggie Riser (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1786?page=c... ]
Reggie Riser commented on HHH-1786:
-----------------------------------
We're an IBM partner, so we escalated this issue up the IBM support chain until we got feedback from the WebSphere Transaction Architect. His take is that WebSphere is complying with the J2EE spec in this instance, and that this problem should definitely not be considered a bug in WebSphere. He said the workaround was OK, and suggested that we lobby Hibernate to integrate it into its codebase.
We've implemented the workaround in our application, but obviously would prefer it be a part of Hibernate proper. Is there any chance of this happening?
Don't shoot the messenger. We're just developers caught in the middle.
> JTASessionContext.CleanupSynch does not remove sessions from currentSessionMap
> ------------------------------------------------------------------------------
>
> Key: HHH-1786
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1786
> Project: Hibernate3
> Issue Type: Improvement
> Affects Versions: 3.1.2
> Environment: IBM WebSphere 6.0.2.7, Hibernate CVS snapshot from 2006-02-24
> Reporter: Tomi Szabo
> Attachments: JTASessionContext.java, WebSphereExtendedJTATransactionLookup.java, WebSphereExtendedJTATransactionLookup.patch.txt
>
>
> We are using JTASessionContext, CMTTransaction and WebSphereExtendedJTATransactionLookup. We have experienced some memmory leak problems and after closer inspection we have found that Hibernate sessions are not removed from currentSessionMap inside JTASessionContext.
> Method JTASessionContext.CleanupSynch.afterCompletion() is called as expected but code "context.currentSessionMap.remove( txn );" does not remove session from Map because of key's hashcode has changed. This is due to fact that com.ibm.websphere.jtaextensions.ExtendedJTATransaction.hashCode is actually ID of underlaying transaction. But if it comes to the afterCompletion method in CleanupSynch the underlaying transaction is already closed. Closed transaction has ID 0 (default value) and it is different from ID under which the Hibernate session was previously inserted into Map.
> Possible patch is in attachements.
--
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
17 years, 5 months
[Hibernate-JIRA] Resolved: (HHH-1700) HAVING clause not supported in Criteria API
by Diego Pires Plentz (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1700?page=c... ]
Diego Pires Plentz resolved HHH-1700.
-------------------------------------
Assignee: Diego Pires Plentz
Resolution: Duplicate
> HAVING clause not supported in Criteria API
> -------------------------------------------
>
> Key: HHH-1700
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1700
> Project: Hibernate3
> Issue Type: New Feature
> Components: query-criteria
> Affects Versions: 3.1.3
> Environment: Hibernate 3.1.3, Oracle 10g (not DB specific)
> Reporter: Manuel Dominguez Sarmiento
> Assignee: Diego Pires Plentz
> Priority: Minor
> Attachments: CustomProjections.java
>
> Original Estimate: 2 hours
> Remaining Estimate: 2 hours
>
> Currently the Criteria API does not support the HAVING clause. I have create a factory class which creates Projection instances using sqlGroupProjection. Probably not the best approach, but an idea which could be further developed. These factory methods could be included in the Projections factory class.
> Usage example w/one property:
> criteria.setProjection(CustomProjections.groupByHaving("id", Hibernate.LONG, "count(distinct id) >= 3"));
> Also allows aliases:
> criteria.setProjection(CustomProjections.groupByHaving("id", "idAlias", Hibernate.LONG, "count(distinct idAlias) >= 3"));
> Usage example w/many properties:
> String[] columns = new String[2];
> columns[0] = "id";
> columns[1] = "name";
> String[] aliases = new String[2];
> aliases[0] = "idAlias";
> aliases[1] = "nameAlias";
> Type[] types = new Type[2];
> types[0] = Hibernate.LONG;
> types[1] = Hibernate.STRING;
> criteria.setProjection(CustomProjections.groupByHaving(columns, aliases, types, "count(distinct id) >= 3 and name='george'"));
--
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
17 years, 5 months
[Hibernate-JIRA] Created: (HHH-2780) named parameter types
by jose (JIRA)
named parameter types
---------------------
Key: HHH-2780
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2780
Project: Hibernate3
Issue Type: Patch
Components: query-hql
Affects Versions: 3.2.5, 3.2.4.sp1
Reporter: jose
This query FAILS______________________
from Entity e
where ((:status is null) or (e.status = :status))
This query WORK______________________
from Entity e
where ((e.status = :status)) or (:status is null))
Fixed with_________________________________
Constructor of org.hibernate.hql.ast.ParameterTranslationsImpl
...
else if ( NamedParameterSpecification.class.isAssignableFrom( spec.getClass() ) ) {
NamedParameterSpecification namedSpec = ( NamedParameterSpecification ) spec;
NamedParamTempHolder paramHolder = ( NamedParamTempHolder ) namedParameterMap.get( namedSpec.getName() );
if ( paramHolder == null ) {
paramHolder = new NamedParamTempHolder();
paramHolder.name = namedSpec.getName();
paramHolder.type = namedSpec.getExpectedType();
namedParameterMap.put( namedSpec.getName(), paramHolder );
*** }else{
*** if (paramHolder.type == null){
*** paramHolder.type = namedSpec.getExpectedType();
*** }
*** }
paramHolder.positions.add( new Integer( i ) );
}
else {
// don't care about other param types here, just those explicitly user-defined...
}
--
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
17 years, 5 months
[Hibernate-JIRA] Commented: (HHH-1396) Table.validateColumns fails on valid column
by Max Rydahl Andersen (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1396?page=c... ]
Max Rydahl Andersen commented on HHH-1396:
------------------------------------------
yes - just telling what the general issue is ;) generally the validatecolumn method is waay to naive.
> Table.validateColumns fails on valid column
> -------------------------------------------
>
> Key: HHH-1396
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1396
> Project: Hibernate3
> Issue Type: Bug
> Components: metamodel
> Affects Versions: 3.1.1
> Reporter: Christopher G. Stach II
> Assignee: Diego Pires Plentz
> Priority: Minor
>
> This may be an Annotations bug (3.1beta8), bug the exception happens in Core.
> This column used to pass when I used this:
> @Column(columnDefinition = "INT UNSIGNED NOT NULL DEFAULT 0", nullable = false)
> I have since changed it to
> @Column(columnDefinition = "INT UNSIGNED DEFAULT 0", nullable = false)
> because "nullable = false" adds the "not null".
> I am guessing that the nullable isn't being used in the validateColumns. I have not yet investigated, but the stack trace is below.
> org.hibernate.tool.hbm2ddl.TableMetadata.<init> table found: xxx.yyy
> org.hibernate.tool.hbm2ddl.TableMetadata.<init> columns: [foo_id, ipaddress, actiontype, timestamp, id]
> com.caucho.server.webapp.Application.start org.hibernate.HibernateException: Wrong column type: ipAddress, expected: INT UNSIGNED DEFAULT 0
> at org.hibernate.mapping.Table.validateColumns(Table.java:219)
> at org.hibernate.cfg.Configuration.validateSchema(Configuration.java:964)
> at org.hibernate.tool.hbm2ddl.SchemaValidator.validate(SchemaValidator.java:116)
> at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:296)
> at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1164)
> [...]
--
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
17 years, 5 months