bug « Query « JPA Q&A





1. hibernate createQuery bug?    stackoverflow.com

Is any way to remove cache for a specific named query? I don't really want to remove for all queries... Or is there any other workaround? It is not working even if ...

2. (N+1) selects Hibernate bug?    coderanch.com

I tried all possible combinations to prevent (N+1), nothing works. Our mapping looks like: -------------------------------- ------------------------------------------------ retrieveUser(userid) ...

3. hibernate bug in select ?    coderanch.com

Hi guys : I have the following mapping file (autogenerated in hibernate). If I uncomment the text inside the a select all NmrPulseStateNuclei winds up causing a "Invalid value for getLong() - '"1H8"' " error. Now, the data in the table is as follows (sample for 1st row). N_pulse_SN_ID=1 N_pulse_SN_State=1 N_pulse_SN_Nucleus=""1H8"" N_pulse_SN_Phase="" N_pulse_SN_Incremented=0 N_pulse_SN_Convolution="" So it looks like hibernate ...

4. [JPA 2.0][3.5-Beta-2] Bug with Typed Queries and count    forum.hibernate.org

According to the website, I'm supposed to post here for bugs first. So be it. So here goes. Using the following JPA 2.0 Query constructor, I want to do the equivalent to: "select count(u) from User u;" I've confirmed with Linda, the JPA 2.0 spec person at Sun that the code for that should look like this: public void CountUsers(EntityManager em) ...

5. Bug in JPA criteria query conversion to SQL query?    forum.hibernate.org

Newbie Joined: Fri Oct 22, 2010 11:06 pm Posts: 11 Hi! I have created a criteria query to get the "permissions" attribute from the Role entity with id = 2, but when executed by Hibernate the generated SQL is invalid. Seems like a bug in Hibernate that couldn't pass unnoticed by everyone else, so I'm assuming there is a good change ...

6. Potential bug for updates after readOnly queries    forum.hibernate.org

Beginner Joined: Fri Oct 10, 2003 4:54 pm Posts: 26 Location: Chicago, IL We encountered the following situation with Hibernate 3.5.6 during a series calls in the same Hibernate Session: 1. Early in the processing, we performed a query with setReadOnly(true) 2. Later in a different piece of code, we performed a query with setReadOnly(false) 3. We then tried to update ...

7. Bug in SQL Native Query with Hibernate 3.6.0 Final?    forum.hibernate.org

CREATE TABLE IF NOT EXISTS application_log ( application_log_id bigint(20) NOT NULL AUTO_INCREMENT, log_code char(3) NOT NULL, message varchar(255) NOT NULL, PRIMARY KEY (application_log_id) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=13 ; INSERT INTO `application_log` (`application_log_id`, `log_code`, `message`) VALUES(1, '100', 'Transaction OK.'); INSERT INTO `application_log` (`application_log_id`, `log_code`, `message`) VALUES(2, '100', 'Transaction OK.'); INSERT INTO `application_log` ...

8. Bug?with )), ORDER BY is ignored and doesn't throw Exception    forum.hibernate.org

Hi, Wondering if anyone else encountered this... SELECT o FROM MyEntity o WHERE (o.type='ACTIVE')) ORDER BY name DESC the result list is not ordered correctly. When the pair of closing parentheses are corrected to be just one, SELECT o FROM MyEntity o WHERE (o.type='ACTIVE') ORDER BY name DESC it sorts correctly. Thing is, shouldn't it throw an exception rather than failing ...

9. hibernate bug for query cache    forum.hibernate.org

i found the bug for query cache for example: table : Dept fields: dept_name(varchar) dept_type(int) dept_order(int) data: dept_name dept_type dept_order dept1 1 0 dept2 1 0 the query: 1 query List list = session.createQuery("select p1 from Dept as p1 where p1.dept_type = :deptType and p1.dept_order = :deptOrder") .setInteger("deptType" , 1).setInteger("deptOrder" , 0).setCacheable(true).setCacheRegion("Dept).list() System.out.println(list.size); 2 query: list = session.createQuery("select p1 from Dept ...





10. Possible BUG in createSQLQuery!    forum.hibernate.org

I'm using Hibernate 2.1.2. Here's my mapping file: MpRequisicaoSq044 Code:

11. Possible bug in 2.1.3 (group by)!    forum.hibernate.org

I'm using Hibernate 2.1.3. By looking at the generated sql from the method code below we can see that it's wrong. The "planoprodu0_.equip_prod_fk" in the "GROUP BY" clause doesn't match the "equipprod1_.id as x0_0_" in the "SELECT" clause. If I take out the "GROUP BY" clause it works,repeats the results which I don't want. Has this been reported? Please, need to ...

12. Native SQL query problem/bug ?    forum.hibernate.org

Newbie Joined: Thu Jun 03, 2004 10:19 am Posts: 3 Hi All, Just having a problem running a simple native sql query. I am using postgresql 7.3.6 and hibernate 2.1.4 When I use a HQL query it works fine. Here is my mapping file. Code:

13. Problem with createSQLQuery (HIbernate bug???)    forum.hibernate.org

Hi Problem was reproduce with 2.0.3 and 2.1.7 Im doing a SQL Query but hibernate seems to use the wrong table mapping, My code looks like: String sql = "select {componentlogs.*} from logs {componentlogs} where rowid in(select rid " + "from (select rowid rid, rownum rnum from (" + "SELECT rowid rid FROM logs where componentno = " + componentno + ...

14. Bug in group by naming of columns?    forum.hibernate.org

I have the below HQL query. There is a problem with the group by section when it is translated into sql. Basically, database complains (postgres) that in the select section, we have select introducti1_.id as x0_0_, user7_.id as x1_0_, user7_.username as x2_0_, user9_.id as x3_0_, user9_.username as x4_0_, but in group by section, this is translated as person6_.user_info , user7_.username , ...

15. hql group by problem (probably bug)    forum.hibernate.org

Author Message snpesnpe Post subject: hql group by problem (probably bug) Posted: Tue Dec 14, 2004 4:44 pm Expert Joined: Sat Jun 12, 2004 4:49 pm Posts: 915 Hello, I have problem with HQL and grouping.I make test case 2 first test are success , but last 3 throw exception When I have join with 2 column from foreign ...

16. where clause bug?    forum.hibernate.org

Hi, I am trying to implement soft deletes in my system. Instead of physically deleting records, the column fld_record_status is set to 'D'. Every table has a fld_record_status column. In my system. I have a tbl_patient table corresponding to Patient.java. and a tbl_visit table corresponding to Visit.java. There is a one-to-many relationship between Patient and Visits. To retrieve only Patient and ...





17. dynamic class with import Bug? Additional query being run    forum.hibernate.org

Newbie Joined: Mon Dec 13, 2004 2:32 am Posts: 8 Hi Everybody, I have noticed a rather unusual and unnecessary execution of an additional query, when i am trying to query an entity using the dynamic-class feature which has a one-2-many relationship with another entity. Here is the sample scenario i made up. A CatOwner is an entity which is related ...

18. Projections.projectionList() bug? Please help me    forum.hibernate.org

Author Message b.devis@witboy.com Post subject: Projections.projectionList() bug? Please help me Posted: Fri May 06, 2005 4:15 am Regular Joined: Thu Feb 24, 2005 2:34 pm Posts: 80 Hibernate version: 3.1rc Hi, i have strange problem if you can look my 2 criteria here, hibernate work fine but in the first return data and in the second criteria don't return ...

19. HQL query translation bug (I'm almost certain)    forum.hibernate.org

return getHibernateTemplate().find( "select tr from TestResult tr " + "join tr.role role " + "join tr.test test " + "inner join tr.testSchedule testSchedule " + ...

20. Order of tuple objects in SQL query result (bug?)    forum.hibernate.org

Hi! I have something like: List rl = session.createSQLQuery("select {o.*}, sum(lt.a) as asum, sum(mt.b) as bsum from Order as o, .... etc. ") .addEntity("o",Order.class) .addScalar("asum",Hibernate.BIG_DECIMAL) .addScalar("bsum",Hibernate.BIG_DECIMAL) .list(); Object[] test = rl.get(0); How to control the order in which the objects are in the Object[3]-tuples? Currently I'm getting results in which test[0] and test[1] are BigDecimals and test[2] is the Order. I've ...

21. Query By Example + YesNoType = Bug ?    forum.hibernate.org

Here's the mapping file: Code:

22. Hibernate Bug when calling custom SQL query    forum.hibernate.org

Newbie Joined: Fri Nov 04, 2005 2:46 pm Posts: 2 Java 1.5 Tomcat 5.5.9 libs from the Hibernate Source Zip of November 17, 2005 I have code which is calling: Code: System.out.println("coming in qry"); strSQL = " SELECT count(T.ticket_id) as Hits, datepart(mm,T.created) as Mn, datepart(yyyy,T.created) as Yr "; strSQL ...

23. Bug with entity-name and find by example?    forum.hibernate.org

24. Possible BUG with Date during query    forum.hibernate.org

I have an object with a Date field. The hibernate maps this object to a java.util.Date. My object also has a compareTo function, which sorts itself by date. When the compareTo function is called, there is an error: java.lang.ClassCastException: java.util.Date at java.sql.Timestamp.compareTo because Hibernate passed in a java.sql.Timestamp. The compiler allows this because Timestamp extends Date - HOWEVER - the documentation ...

25. Hibernate bug? to many queries    forum.hibernate.org

Hello, I came across, what I think is a bug but I want to verify this before moving it to JIRA. Having a uni directional 1:n relation with a key where not-null=true, the following queries are generated, when I issue Code: Developer developer = new Developer(); Computer c = new Computer(); developer.getComputers().add(c); session.save(developer); This is one query to much and when ...

26. Possible bug in Query.setParameterList() in 3.1.2?    forum.hibernate.org

Hibernate version: 3.1.2 Hi, I just updated to from 3.0.5 to 3.1.2 and one of my HQL queries stoped working. The query looks like this: Code: String query = "FROM EntitySpecificationValue esv LEFT JOIN FETCH esv.attributes WHERE esv.identifier IN (:ids)"; List res = session.createQuery(query).setParameterList("ids", ids).list(); ids is a List of Long objects. This used to work in 3.0.5 but now I ...

27. Problem using createSQLQuery (possible bug)    forum.hibernate.org

28. Query returns cached proxies of wrong class. Bug?    forum.hibernate.org

C c = ( C ) session.get( C.class, new Integer( 123 ) ); // lets assume, that assert c.getA() instanceof B1; assert c.getA().getProp1() == 1; assert c.getA().getProp2() == 2; // same object as in c.getA() is expected A a = ( A ) session .createQuery( "from A where prop1 = 1 and prop2 = 2" ) .uniqueResult(); ...

29. Simple Query Caching - Bug?    forum.hibernate.org

Author Message timrobertson100 Post subject: Simple Query Caching - Bug? Posted: Wed May 03, 2006 4:52 am Regular Joined: Wed Jun 29, 2005 11:14 pm Posts: 119 Location: Kbenhavn Need help with Hibernate? Read this first: http://www.hibernate.org/ForumMailingli ... AskForHelp Brief explaination: Query caching is working until I do an update. I see from the logs that a subsequent call ...

30. Polymorph queries and named/bound parameters - is it a bug?    forum.hibernate.org

Hello! I've experienced some issues trying to implement polymorphic query in Hibernate. The first thing I was trying List> classes = getClasses(); Query q = session.createQuery(" from " + Entry.class.getName() + " e where e.class in (:classes)"); q.setParametersList("classes", classes, Hibernate.CLASS); return q.list(); The result was "Invalid character string format for type INTEGER." The same result was even for the ...

32. Hibernate Transformer Bug - Hibernate creating bad query    forum.hibernate.org

This may not be directly related to Transformers, but Hibernate in general. Why Hibernate is using column alias for where clause comparision? I don't think this is standard query. This may work with SQL Server but doesn't work with DB2. What's the solution to this problem??? Can column alias be disabled somehow???

33. Persitence order, bug in hibernate ?    forum.hibernate.org

I am using latest version of hibernate. I have many bags in my class. Class A bag b bag c bag d When I save my object A, hibernate makes 4 SQL calls: INSERT A INSERT B INSERT C INSERT D When I delete my object A, hibernate makes 4 SQL calls: DELETE A DELETE B DELETE C DELETE D It ...

34. Returning null values from Query cache (Bug?)    forum.hibernate.org

Hibernate version: 3.2.4 Hi, I'm using the query cache with Ehcache and the JPA implementation. My request returns 3 elements from the database. Everything is fine. But when Hibernate tries to retrieve the objects from the query cache the list is composed of null objects, Here is the logs: DEBUG org.hibernate.jdbc.ConnectionManager - opening JDBC connection DEBUG org.springframework.jdbc.datasource.DriverManagerDataSource - Creating new JDBC ...

35. (N+1) selects Hibernate bug?    forum.hibernate.org

I tried all possible combinations to prevent (N+1), nothing works. Our mapping looks like: ------------------------------------------- ------------------------------------------------- retrieveUser(userid) -- ...

37. createSQLQuery - Is it a bug?    forum.hibernate.org

Hibernate version: Hibernate 3.0 Code between sessionFactory.openSession() and session.close(): Code: String sql = Select * from xyz List resultSet = session.createSQLQuery(sql).list(); Full stack trace of any exception that occurs: Code: org.hibernate.MappingException: No Dialect mapping for JDBC type: -1 at org.hibernate.dialect.TypeNames.get(TypeNames.java:56) at org.hibernate.dialect.TypeNames.get(TypeNames.java:81) at org.hibernate.dialect.Dialect.getHibernateTypeName(Dialect.java:370) at org.hibernate.loader.custom.CustomLoader$Metadata.getHibernateType(CustomLoader.java:559) ...

38. bug in Query with ?    forum.hibernate.org

I'm executing this query: Query query = sess.createQuery( " from Car as Car where Car.id=?"); query.setParam(0,carPK); where id is Hibernate pk identifier, and value of ? is Object that represents composite primary key. The following exception occures: org.hibernate.QueryException: Expected positional parameter count: 1, actual parameters: [dataaccess.crud.hibernate.CarPk@5b35] [from Car as Car where Car.id=? ] at org.hibernate.impl.AbstractQueryImpl.verifyParameters(AbstractQueryImpl.java:319) at org.hibernate.impl.AbstractQueryImpl.verifyParameters(AbstractQueryImpl.java:275) at org.hibernate.impl.QueryImpl.list(QueryImpl.java:75) at org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:811) ...

39. Query by example bug?    forum.hibernate.org

Hello all, I have a question regarding Querying By Example. I understand that: "Version properties, identifiers and associations are ignored. By default, null valued properties are excluded" But how come the "" string valued properties are also excluded? I have a user in the database, say userInDatabase, like lastName = "lname" firstName = "fname" middleName = "mname" And I want to ...

40. CreateQuery group by bug    forum.hibernate.org

41. Pagination bug in Hibernate    forum.hibernate.org

Hello everybody, I am a new member on this forum and the reason I became a member is because of the way I saw the behavior of the org.hibernate.Query object in Hibernate and I needed to understand how it works. Specifically, I was using the Query.setFirstResult() and Query.setMaxResults() to make my pagination logic work. However, what I found is that the ...