[Hibernate-JIRA] Créée: (HHH-2389) Improving DB2 dialect
by Nicolas Billard (JIRA)
Improving DB2 dialect
---------------------
Key: HHH-2389
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2389
Project: Hibernate3
Type: Improvement
Components: query-hql
Versions: 3.2.1
Environment: Development based on v 3.2.1
Reporter: Nicolas Billard
Priority: Minor
Attachments: DB2Dialect.java
The class joined to this issue overrides the DB2 dialect. The dialect included in hibernate doesn't work very well when you want to limit returned results (when you call setFirstResult and / or setMaxResults on a query) :
- the instructions "fetch first XXX row only is not used
- a temporary table is used when it's not usefull
- when you have subselects, an exception can occur if subselects have order by clause (because of the getRowNumber method, not corrected here).
This version of getLimitString() method generates faster requests (tests made on a table of 300000 rows shows that fetching rows from 20 to 30 takes 0.3 seconds with original version, 0.02 with this one).
--
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
13 years, 5 months
[Hibernate-JIRA] Created: (HHH-5007) Using <formula> within Composite Element inside Collection
by Hepoi Ko (JIRA)
Using <formula> within Composite Element inside Collection
----------------------------------------------------------
Key: HHH-5007
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5007
Project: Hibernate Core
Issue Type: Patch
Components: core
Affects Versions: 3.5.0-CR-2
Environment: 3.5.0-CR2, AS400, Component
Reporter: Hepoi Ko
Priority: Minor
Attachments: JoinWalker.java
I was one of the user who use Hibernate in a legacy database schema, and always had a issue on using composite-key (and formula) inside collection. I was able to modify the hibernate source (from 3.3.2) to overcome such issue. I am hoping the new version 3.5.0 would even fix this problem. Anyway, I just leave the fix information here, hope it would help.
In /org/hibernate/loader/JoinWalker.java
Line 641: String[] aliasedLhsColumns = StringHelper.qualify(alias, lhsColumns);
Modify with these:
String[] fullAliasedLhsColumns = persister.getElementColumnNames(alias);
String[] aliasedLhsColumns = ArrayHelper.slice(fullAliasedLhsColumns, begin, length);
Without above change I would get NullPointerException on a mapping as
....
<set name="auditRecords" table="OEP40A" order-by="ADAT40 DESC, ATIM40 DESC"
mutable="false" inverse="true" outer-join="true">
<key>
<column name="CONO40"></column>
<column name="ORDN40"></column>
</key>
<composite-element class="com.ricoh.erp.order.domain.OrderAudit">
<property name="userId">
<column name="AUSR40"></column>
</property>
<property name="workstationId">
<column name="AWRK40"></column>
</property>
<many-to-one name="customerEntry" not-found="ignore">
<formula>CONO40</formula> <!-- NullPointerException on this line -->
<column name="CUSN40"></column>
<column name="DSEQ40"></column>
</many-to-one>
</composite-element>
With Best Regards,
--
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
13 years, 5 months
[Hibernate-JIRA] Created: (HHH-5574) HQL ORDER BY descending component is not generated properly; DESC is only applied to the last component column
by Gail Badner (JIRA)
HQL ORDER BY descending component is not generated properly; DESC is only applied to the last component column
---------------------------------------------------------------------------------------------------------------
Key: HHH-5574
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5574
Project: Hibernate Core
Issue Type: Bug
Components: query-hql
Affects Versions: 3.6.0.CR1, 3.5.6
Reporter: Gail Badner
Assignee: Gail Badner
Fix For: 3.6.x
HQL ORDER BY descending component is not generated properly; DESC is only applied to the last component column.
For example:
HQL: select z.name, z.address from org.hibernate.test.hql.Zoo z order by z.address DESC, z.name DESC
SQL: select
zoo0_.name as col_0_0_,
zoo0_.street as col_1_0_,
zoo0_.city as col_1_1_,
zoo0_.postalCode as col_1_2_,
zoo0_.country as col_1_3_,
zoo0_.state_prov_id as col_1_4_
from
Zoo zoo0_
order by
zoo0_.street,
zoo0_.city,
zoo0_.postalCode,
zoo0_.country,
zoo0_.state_prov_id DESC,
zoo0_.name DESC
--
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
13 years, 5 months
[Hibernate-JIRA] Created: (HHH-4760) NotAuditedException occurs when auditReader.getRevisions() is called for javassist proxies
by Erik-Berndt Scheper (JIRA)
NotAuditedException occurs when auditReader.getRevisions() is called for javassist proxies
------------------------------------------------------------------------------------------
Key: HHH-4760
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4760
Project: Hibernate Core
Issue Type: Bug
Components: envers
Affects Versions: 3.5.0-Beta-2
Reporter: Erik-Berndt Scheper
NotAuditedException occurs when auditReader.getRevisions() is called for javassist proxies
In my code I see the following stacktrace if I try to retrieve the revision of a javassist proxy:
org.hibernate.envers.exception.NotAuditedException: nl.ibgroep.bap.model.domain.persoon.Ouder_$$_javassist_1 is not versioned!
at org.hibernate.envers.reader.AuditReaderImpl.getRevisions(AuditReaderImpl.java:126)
at nl.ibgroep.bap.dao.impl.AuditRevisionJpaDaoImpl.getRevisionsFor(AuditRevisionJpaDaoImpl.java:58)
Ouder_$$_javassist_1.class is a Hibernate generated javassist proxy for Ouder.class, which is versioned.
Code:
AuditReader vr = AuditReaderFactory.get(this.entityManager);
Class clazz = persistentObject.getClass();
List<Number> revisionNumbers = vr.getRevisions(clazz, persistentObject.getId());
I am able to work around this issue with the following code:
AuditReader vr = AuditReaderFactory.get(this.entityManager);
Class clazz = persistentObject.getClass();
if (persistentObject instanceof javassist.util.proxy.ProxyObject) {
if (LOGGER.isDebugEnabled()) {
StringBuilder output = new StringBuilder("Found javassist ProxyObject for revision: class= ");
output.append(clazz.getSimpleName());
output.append("; superclass= ").append(clazz.getSuperclass().getSimpleName());
output.append("; interfaces= ").append(Arrays.asList(clazz.getInterfaces()).toString());
LOGGER.debug(output.toString());
}
clazz = clazz.getSuperclass();
}
List<Number> revisionNumbers = vr.getRevisions(clazz, persistentObject.getId());
However, a fix in envers would be greatly appreciated.
--
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
13 years, 5 months