开发者

Generated queries contain schema and catalog name

开发者 https://www.devze.com 2022-12-31 15:49 出处:网络
I\'ve the same problem as described here In the generated SQL Informix expects catalog:schema.table but what\'s actually generated is

I've the same problem as described here

In the generated SQL Informix expects catalog:schema.table but what's actually generated is

catalog.schema.table

which leads to a syntax error. Setting:

hibernate.default_catalog=
hibernate.default_schema=

had no effect. I even removed schema and catalog from the table annotation, this caused a different issues : the query looked like that ..table same for setting catalog and schema to an empty string.

Versions

  • seam 2.1.2
  • Hibernate Annotations 3.3.1.GA.CP01
  • 开发者_JS百科
  • Hibernate 3.2.4.sp1.cp08
  • Hibernate EntityManager 3.3.2.GAhibernate
  • Jboss 4.3 (similar to 4.2.3)


Note that there is a new (as of 2010-04-26) web page, http://www.iiug.org/opensource, that has information about using Informix software with various open source packages, including Hibernate. In particular, there is downloadable code that improves the interaction of Hibernate and Informix.


I ended up with the one of the worst hacks I evever did:

The colon is the offending char wich should be '.' catalog:schema.table.

Informix allows comments in SQL statements select {comment} * from sometable

So I set

hibernate.default_catalog={
hibernate.default_schema=}schemaname

the resulting code looks like

select * from {.}schemaname.tablename

which is accepted by informix query parser.


Delete the schema and catalog attributes from *.hbm.xml.

0

精彩评论

暂无评论...
验证码 换一张
取 消