syntax « Test « JPA Q&A

1. JUnit/HSQLDB: How to get around errors with Oracle syntax when testing using HSQLDB (no privilege and/or no DUAL object)

I have DAO code which contains some JDBC with Oracle-specific syntax, for example:

select count(*) cnt from DUAL 
where exists (select null from " + TABLE_NAME + "

2. MySQL syntax error when testing collection size

I have a Hibernate class like this: public class Resource { public Set getUsers() { ... } } I want to get all Resources that have no users. I tried two method, but both failed with MySQL syntax error (1) HQL: "from Resource where users.size=0" Translated SQL sth like: "select * from Resource where (select count(*) from ResourceUsers where" Error ...

3. Query properly generated but I get syntax error in my test

Hi Im using hibernate and spring to connect to oracle 10g, the driver im using is ojdbc6.jar I have tested ojdbc5.jar too Im testing this dao package test.acw.dao.hibernate; import java.sql.SQLException; import org.hibernate.HibernateException; import org.hibernate.Query; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.orm.hibernate3.HibernateCallback; import; import my.test.dao.TestDao; import; import; import my.test.domain.Test; import my.test.domain.dto.TestDto; public class TestDaoImpl extends HibernateDaoSupport ...