[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-5692?page=c...
]
Greg Maczuga commented on HHH-5692:
-----------------------------------
Workaround for Spring is to use LocalSessionFactoryBean and override
postProcessConfiguration method
@SuppressWarnings("unchecked")
@Override
protected void postProcessConfiguration(Configuration config) throws
HibernateException {
String defaultSchema = config.getProperty(DEFAULT_SCHEMA_PROPERTY_NAME);
Set<String> queriesNames = config.getNamedSQLQueries().keySet();
for (String name : queriesNames) {
NamedSQLQueryDefinition namedSQLQuery = (NamedSQLQueryDefinition)
config.getNamedSQLQueries().get(name);
if (namedSQLQuery.getQuery().contains(SCHEMA_PLACEHOLDER)) {
String query = namedSQLQuery.getQuery().replace(SCHEMA_PLACEHOLDER,
defaultSchema + ".");
NamedSQLQueryDefinition newQuery = new NamedSQLQueryDefinition(query,
namedSQLQuery.getQueryReturns(),
namedSQLQuery.getQuerySpaces(), namedSQLQuery.isCacheable(),
namedSQLQuery.getCacheRegion(),
namedSQLQuery.getTimeout(), namedSQLQuery.getFetchSize(),
namedSQLQuery.getFlushMode(),
namedSQLQuery.getCacheMode(), namedSQLQuery.isReadOnly(),
namedSQLQuery.getComment(),
namedSQLQuery.getParameterTypes(), namedSQLQuery.isCallable());
// replace named query definition
config.getNamedSQLQueries().put(name, newQuery);
}
}
}
Invalid {h-schema} replacement in native sql queries
----------------------------------------------------
Key: HHH-5692
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-5692
Project: Hibernate Core
Issue Type: Bug
Affects Versions: 3.5.3
Reporter: Greg Maczuga
Original Estimate: 1h
Remaining Estimate: 1h
Native-sql placeholders for default schema and catalog i.e. {h-schema} replacement
implemented in HHH-2576 have bug.
It doesn't replace {h-schema} in stored procedures calls due to embed brackets i.e.
"{ ? = call {h-schema}manager.check(:userId)}" do NOT get replaced correctly.
--
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