]
Guenther Demetz commented on HHH-7198:
--------------------------------------
N.B.: this happens, when using a *case sensitive collation* at database level:
in this case also the tablenames and columns are case sensistive.
In my concrete case I use SQL_Latin1_General_CP1_CS_AS as collation.
SQLServer2005Dialect.getLimitString turns tablenames to lowercase
-> SQLGrammarException: when mapping tables with capital letters
-----------------------------------------------------------------------------------------------------------------------------------
Key: HHH-7198
URL:
https://hibernate.onjira.com/browse/HHH-7198
Project: Hibernate ORM
Issue Type: Bug
Components: core
Affects Versions: 4.1.1
Environment: Hibernate4, SQLServer2008
Reporter: Guenther Demetz
Priority: Minor
Labels: pagination
Usually when annotating entity classes without the @Table.name attribute, then the
default mapped tablenames begin with a capital letter.
When using the paging feature, SQLServer2005Dialect.getLimitString turns the whole sql to
lowercase
{code:title=SQLServer2005Dialect.java|borderStyle=solid}
@Override
public String getLimitString(String querySqlString, boolean hasOffset) {
StringBuilder sb = new StringBuilder(querySqlString.trim().toLowerCase());
...
return sb.toString();
}
{code}
thus also the included tablenames are all converted to lowercase,
this leads to following schema mismatch exception, when using the original
SQLServerDriver:
org.hibernate.exception.SQLGrammarException: Invalid object name 'mytable'
This bug was introduced with HHH-2655 (ROW_NUMBER for Paging).
Testcase:
{code}
Query query = session.createQuery("from C"); // C is an arbitrary entity class
mapped to a table with uppercase characters in the tablename
query.setMaxResults(10);
query.iterate().next(); // -> Exception
{code}
--
This message is automatically generated by JIRA.
For more information on JIRA, see: