[Hibernate-JIRA] Commented: (HHH-1123) Cannot put more than 1000 elements in a InExpression
by guillaume mathias (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1123?page=c... ]
guillaume mathias commented on HHH-1123:
----------------------------------------
I have a similar error with SQL Server : "Prepared or callable statement has more than 2000 parameter markers"
Even I split the "in" expression, this exception is thrown when the total parameter markers count exceeds the limit parameterized in DBMS (2000 here).
> Cannot put more than 1000 elements in a InExpression
> ----------------------------------------------------
>
> Key: HHH-1123
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1123
> Project: Hibernate3
> Issue Type: Bug
> Components: core
> Affects Versions: 3.1 rc2, 3.2.0.alpha1
> Environment: Oracle 9i
> Reporter: Alexis Seigneurin
> Attachments: patch.txt
>
> Original Estimate: 1 hour
> Remaining Estimate: 1 hour
>
> The number of elements that we can put in a "in" expression is limited to a certain amount (1000 for Oracle, for instance). When creating a criteria query, the org.hibernate.criterion.InExpression class should split the expression into several smaller ones.
> Attached is a patch which splits the expression by slices of 500 elements. For example, if we have 1001 elements to put in the "in" expression, the result would be :
> (entity.field in (?, ?, ?...) or entity.field in (?, ?, ?...) or entity.field in (?))
> The surrounding parantheses are useful to avoid problems with other conditions (a "and" condition taking over the one of the "or" conditions).
--
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
16 years, 8 months
[Hibernate-JIRA] Resolved: (HHH-1738) Add outer join support to DetachedCriteria API for subcriteria
by Diego Pires Plentz (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1738?page=c... ]
Diego Pires Plentz resolved HHH-1738.
-------------------------------------
Assignee: Diego Pires Plentz
Resolution: Duplicate
> Add outer join support to DetachedCriteria API for subcriteria
> --------------------------------------------------------------
>
> Key: HHH-1738
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1738
> Project: Hibernate3
> Issue Type: Patch
> Components: core
> Affects Versions: 3.1.3
> Environment: Hibernate-3.1.3 all database platforms
> Reporter: Darryl Dieckman
> Assignee: Diego Pires Plentz
> Attachments: DetachedCriteria.patch
>
>
> This is a fix related to an already submitted patch for HHH-1162. This patch adds the ability to specify a join type for a subcriteria of a DetachedCriteria. The patch was originall part of a larger patch (HHH-1276) that was not fully applied for some reason.
> A quick summary of the problem occurs when a subcriteria is created for a detached criteria. For example, say you have Foo which has an association to Bar and you want to select all the Foo instances and order by a property of bar. You might say:
> DetachedCriteria criteria = DetachedCriteria.forClass( Foo.class );
> criteria.createCriteria( "bar" ).addOrder( Order.asc( "someproperty" ) );
> In this case the subcriteria will generate an inner join which could have an adverse effect on the results of the query if the user is expecting Foo's will null Bar references to still be returned. The patch will allow the user to say:
> DetachedCriteria criteria = DetachedCriteria.forClass( Foo.class );
> criteria.createCriteria( "bar", JoinFragment.LEFT_OUTER_JOIN ).addOrder( Order.asc( "someproperty" ) );
--
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
16 years, 8 months
[Hibernate-JIRA] Updated: (HHH-1619) Add public DetachedCriteria createAlias(String associationPath, String alias) method to the DetachedCriteria
by Diego Pires Plentz (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1619?page=c... ]
Diego Pires Plentz updated HHH-1619:
------------------------------------
Component/s: query-criteria
> Add public DetachedCriteria createAlias(String associationPath, String alias) method to the DetachedCriteria
> -------------------------------------------------------------------------------------------------------------
>
> Key: HHH-1619
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1619
> Project: Hibernate3
> Issue Type: Improvement
> Components: query-criteria
> Affects Versions: 3.1.3
> Reporter: Aleksei Valikov
> Priority: Minor
> Original Estimate: 10 minutes
> Remaining Estimate: 10 minutes
>
> Hibernate 3.1.2 introduced the possibility to specify join type for aliases in criteria. There was added the following method:
> public Criteria createAlias(String associationPath, String alias, int joinType) throws HibernateException;
> Unfortunatelly, such a method was not added to the DetachedCriteria.
> Resolution is trivial. Please add:
> public DetachedCriteria createAlias(String associationPath, String alias, int joinType) throws HibernateException
> {
> criteria.createAlias(associationPath, alias, joinType);
> return this;
> }
> to the DetachedCriteria class.
--
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
16 years, 8 months
[Hibernate-JIRA] Resolved: (HHH-1619) Add public DetachedCriteria createAlias(String associationPath, String alias) method to the DetachedCriteria
by Diego Pires Plentz (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1619?page=c... ]
Diego Pires Plentz resolved HHH-1619.
-------------------------------------
Assignee: Diego Pires Plentz
Resolution: Duplicate
> Add public DetachedCriteria createAlias(String associationPath, String alias) method to the DetachedCriteria
> -------------------------------------------------------------------------------------------------------------
>
> Key: HHH-1619
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1619
> Project: Hibernate3
> Issue Type: Improvement
> Components: query-criteria
> Affects Versions: 3.1.3
> Reporter: Aleksei Valikov
> Assignee: Diego Pires Plentz
> Priority: Minor
> Original Estimate: 10 minutes
> Remaining Estimate: 10 minutes
>
> Hibernate 3.1.2 introduced the possibility to specify join type for aliases in criteria. There was added the following method:
> public Criteria createAlias(String associationPath, String alias, int joinType) throws HibernateException;
> Unfortunatelly, such a method was not added to the DetachedCriteria.
> Resolution is trivial. Please add:
> public DetachedCriteria createAlias(String associationPath, String alias, int joinType) throws HibernateException
> {
> criteria.createAlias(associationPath, alias, joinType);
> return this;
> }
> to the DetachedCriteria class.
--
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
16 years, 8 months
[Hibernate-JIRA] Created: (HHH-2653) DetachedCriteria does not create assocation criteria with alias
by Jörg Heinicke (JIRA)
DetachedCriteria does not create assocation criteria with alias
---------------------------------------------------------------
Key: HHH-2653
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2653
Project: Hibernate3
Issue Type: Bug
Components: query-criteria
Affects Versions: 3.2.4.sp1
Reporter: Jörg Heinicke
It's known that ordering on association properties in the criteria API only works with aliases (http://forum.hibernate.org/viewtopic.php?t=972241 and countless other threads, HHH-2629). Unfortunately, you can't even use the aliases with DetachedCriteria since it has a bug:
public DetachedCriteria createCriteria(String associationPath, String alias) throws HibernateException {
return new DetachedCriteria( impl, criteria.createCriteria(associationPath) );
}
public DetachedCriteria createCriteria(String associationPath) throws HibernateException {
return new DetachedCriteria( impl, criteria.createCriteria(associationPath) );
}
As you can see both implementations are equal, the first one ignores the alias parameter. It has to be
public DetachedCriteria createCriteria(String associationPath, String alias) throws HibernateException {
return new DetachedCriteria( impl, criteria.createCriteria(associationPath, alias) );
}
--
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
16 years, 8 months
[Hibernate-JIRA] Resolved: (HHH-1685) DetachedCriteria doesn't create alias on subcriteria
by Diego Pires Plentz (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1685?page=c... ]
Diego Pires Plentz resolved HHH-1685.
-------------------------------------
Resolution: Fixed
Fix Version/s: 3.2.6
Done in trunk/branch 3.2
> DetachedCriteria doesn't create alias on subcriteria
> ----------------------------------------------------
>
> Key: HHH-1685
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1685
> Project: Hibernate3
> Issue Type: Bug
> Components: query-criteria
> Affects Versions: 3.2.5
> Reporter: John
> Assignee: Diego Pires Plentz
> Fix For: 3.2.6
>
> Attachments: hhh1685-example.txt
>
>
> DetachedCriteria has two createCriteria methods:
> public DetachedCriteria createCriteria(String associationPath) throws HibernateException
> public DetachedCriteria createCriteria(String associationPath, String alias) throws HibernateException
> However, the code for both was identical - they called the inner criteria's createCriteria(String) method. The version with the alias did not call the inner's version with the alias. The following patch snipped shows the change:
> public DetachedCriteria createCriteria(String associationPath, String alias)
> throws HibernateException {
> - return new DetachedCriteria( impl, criteria.createCriteria(associationPath) );
> + return new DetachedCriteria( impl, criteria.createCriteria(associationPath, alias) );
> }
> This bug was discovered while trying to link a 2-deep subquery to its parent via aliases. (Surfacing this issue might only be possible with the patch HHH-952 in place - I'm not sure. Seems like a bug regardless, as it definitely fixed my alias reference issue.) I'll get an example posted shortly.
--
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
16 years, 8 months