[Hibernate-JIRA] Created: (HHH-4943) ilike support is incomplete
by James Nobis (JIRA)
ilike support is incomplete
---------------------------
Key: HHH-4943
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4943
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.3.2
Environment: 3.3.2GA
MySQL/PostgreSQL
Reporter: James Nobis
ILIKE is currently supported for PostgreSQL in:
hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/criterion/IlikeExpression.java:
if ( dialect instanceof PostgreSQLDialect ) {
return columns[0] + " ilike ?";
}
else {
return dialect.getLowercaseFunction() + '(' + columns[0] + ") like ?";
}
//TODO: get SQL rendering out of this package!
1) This should be in the Dialect
2) PostgreSQL isn't the only DB with ILIKE
3) using instanceof for this is just sloppy
4) this implementation using getLowercaseFunction works with MySQL but fails with DBs like Firebird
--
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, 7 months
[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, 7 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, 7 months
[Hibernate-JIRA] Created: (HHH-1994) Problem with case sensitive column and tables names and Identity mapping with postgreSQL
by Alex Samad (JIRA)
Problem with case sensitive column and tables names and Identity mapping with postgreSQL
----------------------------------------------------------------------------------------
Key: HHH-1994
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1994
Project: Hibernate3
Type: Bug
Components: core
Versions: 3.1.3
Environment: Hibernate 3.1.3, Java 1.5.0_07 (sun) windos and linux ( 32 & 64 bit). POstgres SQL 8.1 Windows and linux
Reporter: Alex Samad
Whilst trying to insert into a table with a primary key (ID mapping) which has a identity generator. And the columns and/or the table has been defined with case sensitivey ie back ticks.
It fails to get the next serial number and thus fails any inserts.
The problem lies in dialect/PostgreSQLDialect.java
public String getIdentitySelectString(String table, String column, int type) {
return new StringBuffer().append("select currval('")
.append(table)
.append('_')
.append(column)
.append("_seq')")
.toString();
}
table is inclosed in quotes and column is inclosed in quotes which gives a name like
"table"_"Column"_seq - which fails
I would suggest a fix is to test each of table or column for " and if it exist then to strip it of both of table and column and encluse the whole name in "". This mighe break some old code where say the table is coded in case insensitive table name and case sensitive column key.
Sorry not much of a java programmer.
--
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, 7 months
[Hibernate-JIRA] Created: (HHH-3325) Pagination with Oracle ROWNUM is sub-optimal
by e. wernli (JIRA)
Pagination with Oracle ROWNUM is sub-optimal
--------------------------------------------
Key: HHH-3325
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3325
Project: Hibernate3
Issue Type: Bug
Affects Versions: 3.2.5
Reporter: e. wernli
Pagination with Oracle ROWNUM is sub-optimal
The feature works but result in sub-optimal SQL. The generated SQL is the following:
select * from ( select row_.*, rownum rownum_ from ( select this_.id as id3_0_, this_.version as version3_0_, this_.name as name3_0_, this_.type as type3_0_, this_.marketstatus as marketst5_3_0_ from Customer this_ order by this_.id asc ) row_ ) where rownum_ <= ? and rownum_ > ?
But this SQL is faster:
SELECT *
FROM (SELECT row_.*, ROWNUM rownum_
FROM (SELECT this_.ID AS id3_0_, this_.VERSION AS version3_0_,
this_.NAME AS name3_0_, this_.TYPE AS type3_0_,
this_.marketstatus AS marketst5_3_0_
FROM customer this_
ORDER BY this_.ID ASC) row_
WHERE ROWNUM <= ?)
WHERE rownum_ > ?
The second solution allows Oracle to use an optimization that can dramatically reduce the time of the query, especially one of the first page is retrieved.
See this link for an explanation of this optimization: http://decipherinfosys.wordpress.com/2007/08/09/paging-and-countstopkey-o...
--
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, 7 months
[Hibernate-JIRA] Created: (HHH-4956) Native Query returns wrong results
by Akashdeep Saddi (JIRA)
Native Query returns wrong results
----------------------------------
Key: HHH-4956
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4956
Project: Hibernate Core
Issue Type: Bug
Components: query-sql
Affects Versions: 3.3.2
Environment: hibernate 3.3.2.GA , linux, oracle 10g, weblogic 10
Reporter: Akashdeep Saddi
Issue: In-case running native queries vai hibernate we have two technical ID's in the select clause from join of two or more tables the value of all the id's is set to one value.
Example
A.id = 1
B.id =2
select A.Id as A_ID, B.Id as B_ID from A, B where A.B_id = B.id will return 1,1 in the result instead of 1,2
Resolution: Use Alias in-case more than one technical keys are part of select clause. Above query works fine when changed as below
select A.Id , B.Id from A, B where A.B_id = B.id will return 1,2
--
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, 7 months