substitution « Query « JPA Q&A





1. Why parameter substitution in HQL-Query failed but native type succeeds?    stackoverflow.com

did one of you ever had the problem that parameter substitution in a HQL-Query didn't worked? I'm using hibernate for some, I think, simple queries getting entities from my MySQL Database. Here are ...

3. Query language substitutions, Oracle    forum.hibernate.org

4. Query language substitutions: {} fails    forum.hibernate.org

I get the below error message when I un my test harness. Can someone tell me what it is that I am doing wrong? **************** Error Message *************** INFO: Query language substitutions: {} F Time: 4.578 There was 1 failure: 1) test0001Load(com.db.gcp.lem.cds.test.data.DocTypeDAOTest)junit.framework.AssertionFailedError: expected:<1> but was:<0> at com.db.gcp.lem.cds.test.data.DocTypeDAOTest.test0001Load(DocTypeDAOTest.java:26) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at com.db.gcp.lem.cds.test.data.DocTypeDAOTest.main(DocTypeDAOTest.java:19) ***************** Test Stub ******************* public ...

5. hibernate.query.substitutions    forum.hibernate.org

java.lang.NumberFormatException: Y at java.lang.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1176) at java.lang.Double.valueOf(Double.java:168) at oracle.jdbc.driver.OracleStatement.getBooleanValue(OracleStatement.java:4393) at oracle.jdbc.driver.OracleResultSetImpl.getBoolean(OracleResultSetImpl.java:479) at oracle.jdbc.driver.OracleResultSet.getBoolean(OracleResultSet.java:1494) at net.sf.hibernate.type.BooleanType.get(BooleanType.java:19) at net.sf.hibernate.type.NullableType.nullSafeGet(NullableType.java:62) at net.sf.hibernate.type.NullableType.nullSafeGet(NullableType.java:53) at net.sf.hibernate.type.AbstractType.hydrate(AbstractType.java:66) at net.sf.hibernate.loader.Loader.hydrate(Loader.java:611) at net.sf.hibernate.loader.Loader.loadFromResultSet(Loader.java:552)

6. Bad substitution on class wide where clause    forum.hibernate.org

I'm trying to use a class wide "where" clause to only retrieve entities that have not been logically deleted using the following snippet in my configuration files. When hibernate converts this to the sql to send to PostgreSQL it tacks on the table alias in front of the false, breaking the query syntax. select useraccoun0_.user_id as user_id, ...

8. Query substitution syntax    forum.hibernate.org

9. Substitutions in Order By Clause    forum.hibernate.org





10. hibernate.query.substitutions    forum.hibernate.org

11. Query Substitutions    forum.hibernate.org

Hibernate version: 3.0 Hi I cannot seem to work out how to use the Query Substitution! I have been searching the forum to no avail and there is nothing mentioned in Hibernate in Action. We are working with a legacy database where boolean type values are stored as 1 character Y or N values. I am using the yes_no type in ...

12. Querying with query.setBoolean() ignores query.substitutions    forum.hibernate.org

We are using hibernate 3.0.5. I have the following property defined in my hibernate configuration file: true 'Y', false 'N', yes 'Y', no 'N' Instances of User class are persisted using hibernate. active is an instance variable of the User class and its hibernate type is "yes_no" and its java type is java.lang.Boolean. In the database, it is stored as ...

13. createSQLQuery IN/UNION substitution 3.1rc3    forum.hibernate.org

Hibernate version: 3.1rc3 I'm new to Hibernate but I've searched the web / doc and found conflicting answers that I think are due to functionality change between versions of Hibernate. I have a complicated query that requires an IN where the IN is evaluated against a UNION. That is : select user from user where user.id in (SELECT id oneWay UNION ...

15. substitution for find()    forum.hibernate.org

16. LIKE to ILIKE : how to use query.substitutions to solve it?    forum.hibernate.org

You have done nothing wrong as such just caught up with a change in the parser. H3 uses a formal parser that is making sure the tokens are correct while H2 passed through anything it did not understand. ilike is not a reserved word so it H2 would pass it through and H3 will complain as it was expecting a valid ...





17. Derby and hibernate.query.substitutions    forum.hibernate.org

I have a problem trying to use Derby with Hibernate version:3.2.5.ga where the hibernate configuration looks like Code: org.apache.derby.jdbc.EmbeddedDriver jdbc:derby:whatson;create=true org.hibernate.dialect.DerbyDialect true 1, ...

18. Query substitutions not working    forum.hibernate.org

Hi all. I am using hibernate + derby. I put true 1, false 0 In configuration file for substituting short to boolean. I am getting error like , ERROR BasicPropertyAccessor: - expected type: java.lang.Boolean, actual value: java.lang.Short I tried with changing config to true 1, false 0 and even tried giving this property runtime as, props.put("hibernate.query.substitutions", "true 1, false ...