Cross-connect issue in sleep mode

I am using Hibernate 3.2 for my J2EE application with Spring 2.5. I recently need a hibernate 3.5 function (support for BigInt Identity). So I updated my sleep mode and am now facing another problem with my requests.

HQL query: -

select table from tableVO table where tableVO.subTableVO.id=:tableVO.id 

SQL Query: -

 select table_1_ID from table cross join subTable where subTable.id =table.id 

I see that the cross-connection is in sleep mode that is not accepted by Sybase ASE. How can i fix this?

+4
source share
3 answers

Check the dialect that you set in the hibernation configuration. I assume that you are working on Sybase ASE 15.x. As you know, Sybase does not yet support CROSS JOIN, which is what SybaseDialect is trying to use. Use SybaseASE157Dialect or SybaseASE15Dialect instead . It will generate syntax that should look like this:

 select table_1_ID from table, subTable where subTable.id =table.id 
+2
source

You can change the sleep dialogs,

in hibernate.cfg

 <property name="hibernate.dialect">com.YourProject.YourDialect</property> 

in your dialect class you need to enter the syntax you want to execute.

dialect example for DB2

 public class DB2390Dialect extends DB2Dialect { public String getIdentitySelectString() { return "select identity_val_local() from sysibm.sysdummy1"; }... } 

Hope this helps

+1
source

This is a bug with implicit joins in Hibernate. You can fix this by merging your connections:

 select table from tableVO table join tableVO.subtableVO subtable where subtable.id=:tableVO.id 
0
source

Source: https://habr.com/ru/post/1337731/


All Articles