[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
12 years, 10 months
[Hibernate-JIRA] Resolved: (HHH-811) Error when using Expression.ilike with Firebird
by Strong Liu (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-811?page=co... ]
Strong Liu resolved HHH-811.
----------------------------
Assignee: Strong Liu
Resolution: Rejected
since there already has workaround, and it is not a problem in firebird 2.0, i'm rejecting this issue, reopen it if anyone has objection :D
> Error when using Expression.ilike with Firebird
> -----------------------------------------------
>
> Key: HHH-811
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-811
> Project: Hibernate Core
> Issue Type: Bug
> Components: core
> Affects Versions: 3.1 beta 1
> Environment: WIN2K - SP4, J2SDK(1.4.2_08), Tomcat 5.5.7 (Netbeans 5.1), Firebird 1.5.1.4481, JDBC 1.5.5 (jaybird).
> Reporter: Bento XVI
> Assignee: Strong Liu
> Priority: Minor
>
> I'm using hibernate with firebird (my dialect property is org.hibernate.dialect.FirebirdDialect).
> If I create a criteria like this "criteria.add(Expression.ilike(String, String, MatchMode.ANYWHERE));", I receive the following error:
> SEVERE: GDS Exception. 335544569. Dynamic SQL Error
> SQL error code = -804
> Function unknown
> LOWER
> 30/07/2005 11:29:59 org.apache.catalina.core.StandardWrapperValve invoke
> SEVERE: Servlet.service() for servlet jsp threw exception
> org.hibernate.exception.GenericJDBCException: could not execute query
> The problem is that Firebird doesn't have the LOWER function.
> The sql generated by hibernate (select this_.cod_field as cod1_0_, this_.txt_field as txt2_0_0_ from MYTABLE this_ where lower(this_.txt_field) like ? order by this_.txt_field asc) throws the same error if executed directly in Firebird.
> I'm posting this bug as "Critical" because it produces a crash.
> But, at the same time lots of workarounds are possible. The most simple is to use createQuery instead createCriteria. Another one is to write my own FirebirdDialect and override the getLowercaseFunction() and make it returns "upper" instead "lower".
--
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
12 years, 10 months
[Hibernate-JIRA] Commented: (HHH-811) Error when using Expression.ilike with Firebird
by Strong Liu (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-811?page=co... ]
Strong Liu commented on HHH-811:
--------------------------------
http://www.destructor.de/firebird/charsets.htm
afaik, now firebird 2.0 has upper() and lower() support, so, this should not a problem anymore
> Error when using Expression.ilike with Firebird
> -----------------------------------------------
>
> Key: HHH-811
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-811
> Project: Hibernate Core
> Issue Type: Bug
> Components: core
> Affects Versions: 3.1 beta 1
> Environment: WIN2K - SP4, J2SDK(1.4.2_08), Tomcat 5.5.7 (Netbeans 5.1), Firebird 1.5.1.4481, JDBC 1.5.5 (jaybird).
> Reporter: Bento XVI
> Priority: Minor
>
> I'm using hibernate with firebird (my dialect property is org.hibernate.dialect.FirebirdDialect).
> If I create a criteria like this "criteria.add(Expression.ilike(String, String, MatchMode.ANYWHERE));", I receive the following error:
> SEVERE: GDS Exception. 335544569. Dynamic SQL Error
> SQL error code = -804
> Function unknown
> LOWER
> 30/07/2005 11:29:59 org.apache.catalina.core.StandardWrapperValve invoke
> SEVERE: Servlet.service() for servlet jsp threw exception
> org.hibernate.exception.GenericJDBCException: could not execute query
> The problem is that Firebird doesn't have the LOWER function.
> The sql generated by hibernate (select this_.cod_field as cod1_0_, this_.txt_field as txt2_0_0_ from MYTABLE this_ where lower(this_.txt_field) like ? order by this_.txt_field asc) throws the same error if executed directly in Firebird.
> I'm posting this bug as "Critical" because it produces a crash.
> But, at the same time lots of workarounds are possible. The most simple is to use createQuery instead createCriteria. Another one is to write my own FirebirdDialect and override the getLowercaseFunction() and make it returns "upper" instead "lower".
--
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
12 years, 10 months