fails « Query « JPA Q&A





1. Hibernate query using hsqldb fails on Hudson / Jenkins, work on local    stackoverflow.com

I have a quite big project in java using Spring 3 + Hibernate 3.3.2.GA. I'm using Maven 2 and JUnit 4, and Jenkins has been our CI server for a couple ...

2. Query runs in Hibernate using WAS 6 but fails in WAS 7    stackoverflow.com

I have a query:

select TO_DATE(TRUNC(table1.DATE_SENT)) AS "dateSent"
Datatype of DATE_SENT is : Timezone with TimeStamp This works in WAS 6.1 but in WAS 7.0 I get :
No dialect mapping for JDBC ...

3. big insert query fails Hibernate\Postgresql    stackoverflow.com

I'm trying to find out the root cause of failure in existing system. I don't know much about it, but looks like the issue is in inserting big row into Postregsql ...

4. Why does this Hibernate Criteria Query fails with "No explicit selection and an implicit one cold not be determined"?    stackoverflow.com

I have an entity called Bucket, and I'm trying to build a criteria query to determine whether there is a Bucket stored with the "Name" property equals to "Bucket_1". So basically ...

5. hibernate: two 'like' clauses in sql fails.    coderanch.com

Hi, My database is mysql4.1.1, when I query it via hibernate with just one 'like' expression, it works fine, eg: Criteria criteria = session.createCriteria(npd.hibernate.Plant.class); criteria.add( Expression.like("genus", plantForm.getGenus() +"%" )); list = criteria.list(); The sql that's generated is: Hibernate: select this.id as id0_, this.active as active0_, this.genus as genus0_, this.species as species0_ from plant this where this.genus like ? order by this.genus ...

7. Why does this Hibernate Criteria Query fails??    forum.hibernate.org

CriteriaBuilder criteriaBuilder = em.getCriteriaBuilder(); CriteriaQuery superQuery = criteriaBuilder.createQuery(Boolean.class); Class scopeClass = Bucket.class; Root root = superQuery.from(scopeClass); Path attributePath = root.get("Name"); Predicate pred = criteriaBuilder.equal(attributePath, criteriaBuilder.literal("Bucket_1")); Subquery subQuery = superQuery.subquery(scopeClass); subQuery.where(pred); Predicate where = criteriaBuilder.exists(subQuery); superQuery = superQuery.select(where); /* This line fails!! */ TypedQuery typedQuery = em.createQuery(superQuery); boolean result = typedQuery.getSingleResult();

8. query fails every second time !    forum.hibernate.org

hi, i am executing a native sql to get a value. this query fails the first time i call the web page. second time, it produces correct result. List list = session.createSQLQuery(" select max(CAST(substring(p1.part_category_id,9,25) as int)) as {p1.part_category_id} from part_category_master {p1} where p1.part_category_id like 'partcat%' ","p1",part_category_master.class).list(); meaning: substring a field to get integer and then return its max value in table. ...

9. HQL aggregate query fails    forum.hibernate.org





11. query by example fails using reference object    forum.hibernate.org

Read the rules before posting! http://www.hibernate.org/ForumMailingli ... AskForHelp I am expecting back only purchased products where the product matches. Instead I get back all purchased product objects, regardless of product, from the database. For queries where I set properties such as a String , int etc this works fine. It fails when I pass in a refernce object. What am I ...

12. hql fails parse: select count(*) from (select count(*) ...))    forum.hibernate.org

Hibernate version: 3.0.4 Name and version of the database you are using: Oracle 10g I hope by answering other questions I get some good forum karma. :) I am trying to do: (pseudo HQL query, actual HQL below) Code: select count(*) from (select count(*) from x join x.y group by x.a) but get an error (listed below). In Oracle I can ...

13. like fails with MySQL if string has back slash    forum.hibernate.org

problem description: With Hibernate 3.0 and MySQL 5.0 queries with the like operator return no results if term searched for contains a backslash. All queries perform without throwing any errors. With records having values ""java", "carl.java", "dir2\\carl.java", and "d:\\dir1\\carl.java", the find equal query correctly returns the appropriate record. However the findEndsWith query returns 0 records for when searching on any pattern ...

14. Calendar Object in the Where clause fails....    forum.hibernate.org

15. newbie question --> session.createQuery() fails    forum.hibernate.org

Hello All, I am newbie to Hibernate. Today, I am assigned one issue to fix is ASAP. Whenever i execute following query against Oracle database and schema1 [b]session.createQuery("from " + objectName + orderBy)[/b] i am getting following exception. [b]org.hibernate.ObjectNotFoundException: No row with the given identifier exists:[/b] But the same code works fine with schema2. As i have been assigned this task ...





17. hibernate 3.0 query fails under 3.1    forum.hibernate.org

i see that hibernate 3.1 don't convert parameter added to query - previous versions do ti for example, if property a is string and you whave query : ... entity.a=? and add q.setParameter(0,anyObject); last hibernate 3.1 will not convert anyObject to String, previous versions (3.0 and any version 3.1 before do conversion query don't get error - it return null, only ...

18. HQL fails in translating 'group by' construct    forum.hibernate.org

Author Message g.tomassoni Post subject: HQL fails in translating 'group by' construct Posted: Fri May 19, 2006 10:02 am Beginner Joined: Thu Mar 18, 2004 8:11 am Posts: 38 Location: Italy Dears, I believe to have found a bug in the HQL query translation code. When I attempt to execute the following HQL query: Code: select c from Company ...

19. createQuery fails with table name containing a space    forum.hibernate.org

Hibernate version: 3.0.2 How do you call createQuery when a legacy table name contains a space. A SQL Server database table name is "dbo.Poll C". I am using the alias m. createQuery will not work when the table name has a space before the "C". I tried the following but none work: Query q = session.createQuery("from dbo.Message t inner join dbo.Poll ...

22. SELECT new myClass(...) fails in 3.2.2    forum.hibernate.org

23. Refresh of item fails to remove newly added entries in Sets?    forum.hibernate.org

Caused by: org.hibernate.HibernateException: this instance does not yet exist as a row in the database at org.hibernate.event.def.DefaultRefreshEventListener.onRefresh(DefaultRefreshEventListener.java:77) at org.hibernate.impl.SessionImpl.refresh(SessionImpl.java:679) at org.hibernate.engine.Cascades$3.cascade(Cascades.java:112) at org.hibernate.engine.Cascades.cascadeAssociation(Cascades.java:771) at org.hibernate.engine.Cascades.cascade(Cascades.java:720) at org.hibernate.engine.Cascades.cascadeCollection(Cascades.java:895) at org.hibernate.engine.Cascades.cascadeAssociation(Cascades.java:792) at org.hibernate.engine.Cascades.cascade(Cascades.java:720) at org.hibernate.engine.Cascades.cascade(Cascades.java:847) ...

24. SELECT COUNT(*) fails on Linux but not on Windows XP    forum.hibernate.org

Need help with Hibernate? Read this first: http://www.hibernate.org/ForumMailingli ... AskForHelp Hibernate version: 3.x--Whatever ships with Spring 2.0.7 Name and version of the database you are using: Informix IDS 9.x The generated SQL (show_sql=true): (From P6 spy) select count(*) as col_0_0_ from POOL poolinfo0_ where poolinfo0_.DEF_DATE='2008-02-11 00:00:00.0' and poolinfo0_.DIVISION_CODE='3' Debug level Hibernate log excerpt: 64854 DEBUG org.hibernate.jdbc.ConnectionManager | opening JDBC connection 64854 ...

25. Criteria query fails    forum.hibernate.org

Hello, I am trying to run a simple query using the Criteria object, but I am the StringIndexOutOfBoundsException. Any ideas on what I maybe doing wrong? thanks Hibernate version: 3.2.5.ga Code between sessionFactory.openSession() and session.close(): Code: Session session = sessionFactory.getCurrentSession(); Criteria criteria = session.createCriteria(org.openiam.idm.srvc.user.dto.User.class); criteria.add(Restrictions.between("lastUpdate", startDate, endDate)); List results = ...

26. HQL fails on nested query    forum.hibernate.org

session.createQuery( "select P from Product P where 4 > (" + "select (" + "select count(U) from User U" + ")" + " + count(PE) from Person PE" + ...

27. org.hibernate.loader.Loader fails on Criteria.SetMaxResults    forum.hibernate.org

The details of this are VERY sketchy... but in our Oracle9i, a particular very long query generated by hibernate will hang. Calling setMaxResults on the criteria creates 1 parameter by tacking "where rownum <= ?" to the end of the query. After copying and isolating this query to run in a standalone test case of establishing a java.sql.Connection and forming a ...

28. Simple JoinTable query fails with mysql but works with pgsql    forum.hibernate.org

Newbie Joined: Thu Oct 09, 2008 4:10 pm Posts: 1 Hi all, We are trying to migrate our db from pgsql to mysql. Everything are ok expect queries contains subquery to a many-to-many explicit join table. Mysql always complains "Operand should contains 1 column(s)". Hereunder are simple test code Code: import javax.persistence.*; import org.hibernate.annotations.GenericGenerator; @Entity @Table( name = "student") public class ...

29. em.find() fails but an HQL query succeeds    forum.hibernate.org

30. Query using Date fails !    forum.hibernate.org

31. Query sometimes fails with "not in aggregate function or gr"    forum.hibernate.org

util.JDBCExceptionReporter - Not in aggregate function or group by clause: org.hsqldb.Expression@647a7347 in statement [select testoutcom0_.analysis_state_id as col_0_0_, count(testoutcom0_.analysis_state_id) as col_1_0_, analysisst1_.id as id7_, analysisst1_.version as version7_, analysisst1_.is_analyzed as is3_7_, analysisst1_.is_bug as is4_7_, analysisst1_.is_default as is5_7_, analysisst1_.name as name7_ from test_outcome testoutcom0_ inner join analysis_state analysisst1_ on testoutcom0_.analysis_state_id=analysisst1_.id where testoutcom0_.test_run_id=? group by testoutcom0_.analysis_state_id]

33. Query fails due to "Missing IN or OUT parameter at index: 2"    forum.hibernate.org

After upgrade hibernate-core to version 3.3.2, some namedQuerys fails due to "Missing IN or OUT parameter at index:: 2". Aparently, this error is related to setting filter parameter in the subselect generated by "inElements" in the HQL query. Below follows an example: 1) Mapping for entity "Customer", with filter definition used to restrict customers by id: Code: