views:

56

answers:

2

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
  • Hibernate 3.2.4.sp1.cp08
  • Hibernate EntityManager 3.3.2.GAhibernate
  • Jboss 4.3 (similar to 4.2.3)
+1  A: 

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.

Jonathan Leffler
+1 Thanks, this provides patches for a distinct hibernate version, I will check that later.
stacker
Unfortunatly It's a different version of hibernate, besides that the build fails 'Embedded error: uanble to execute po2xml : Cannot run program "po2xml": CreateProcess error=2'
stacker
po2xml is a known (even if not well-known) program - it may be that there's an undocumented dependency on that. A search with Google shows that it is available for Ubuntu.
Jonathan Leffler
A: 

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.

stacker
@stacker: Choose this answer as accepted otherwise this question will appear on unanswered
Shervin
@Shervin I still hope for another answer perhaps someone else has a better solution, I haven't had the time to check Johnathans.
stacker