If you would like to test the Advantage Hibernate dialect before it is officially released in March, feel free to e-mail advantage@iAnywhere.com and put “Attn: Alex Wong” in the subject and ask to test the Hibernate dialect.
Alex Wong commented
We are still investigating this. However, I am unclear what specifically feature is preventing you from using Advantage. It seems to me that you can probably just use the base Dialect or one of the other existing dialects (MySQL dialect for example) with Advantage JDBC driver and it should provide the basic functionality. I started looking into this about a week ago so it is quite likely that I am misunderstanding the problem. I just want to make sure that we are addressing the problem correctly.
Daniel B. Chapman commented
Thank you for investigating. I think it is easier than it is made out to be. Dialects will really help us.
Daniel B. Chapman commented
I have to second this (+3), without the Dialects we're running into problems. I'm implementing a JBoss solution (Hibernate) and we need a Dialect (Which I can't imagine would be a massive job--literally we're talking about extending a class).
My code is littered with things that look like ->
Query q = em.createNativeQuery("SELECT Max(ID) FROM $Table");
Integer max = (Integer)q.getSingleResult();
to get the Entities up and rolling. JPA is still usable, but I'm having looking at doing anything quickly its a pain.
This is particularly complicated in multiple queries within a single transaction. Basically I have to do a lot of native SQL to make this work. It's frustrating, and honestly, with the plethera of other Dialects out there porting to MySQL/SQL Server isn't an issue. This system has not been moved specificially because we need Advantage compatibility, but I can say I would not use advantage for any Enterprise system until this is resolved.
Hibernate is the big one, but really all we need is a JPA package _OR_ a hibernate Dialect. I don't think people are using a Toplink/EclipseLink implementation at this point very often with Advantage. But support for Eclipselink 2.0 would be an absolute plus. This, again, is simply a dialect.
If the JDBC Drive would report the text of the bad query (via an option even) that would save a lot of headaches. Either that or enable the logging of bad queries.
Caused by: com.extendedsystems.jdbc.advantage.ADSException: [Extended Systems][Advantage JDBC]State = 42000; NativeError = 2115; [iAnywhere Solutions][Advantage SQL Engine]Expected lexical element not found: identifier or expression -- Location of error in the SQL statement is: 55 There was a problem parsing the WHERE clause in your SELECT statement.
Isn't useful when you can't see inside the ORM easily to see what the query being generated is.
Summary -> Make the JDBC have a verbose options (massive help and this wouldn't be too hard I think--I'm seeing the parser output)
Add a Hibernate Dialect and an Eclipselink Dialect.
The Java persistence Api (JPA) is based on hibernate. Whithout this feature, ADS will never be used from Java Programmers.