generate 2 « Query « JPA Q&A





2. Incorrect Where Clause generate from session cache    forum.hibernate.org

We have an instance of Vendor class, that has a collection of Accounts that are lazily loaded. If we get the vendor, then run a query for all Vendors and then access the accounts of the original vendor, Hibernate appends multiple vendor IDs in the where clause, because we ran the all vendors query in between. The strange thing is it ...

3. problem in generating HQL query    forum.hibernate.org

4. Generated query SQL has duplicated column names    forum.hibernate.org

/* Formatted on 2007/09/26 16:36 (Formatter Plus v4.8.7) */ SELECT this_.c_tarea_id AS c1_2_10_, this_.d_comentario AS d2_2_10_, this_.f_alta AS f3_2_10_, this_.f_hecho AS f4_2_10_, this_.f_plazo AS f5_2_10_, this_.c_mgestionado_modelo AS c7_2_10_, ... estado5_.d_nombre AS d4_0_1_, opciones6_.c_tarea_id AS c1_12_, ...

5. wrong sql generation from hql,missing table in 'from' clause    forum.hibernate.org

Hello, I encountered a problem of a bad sql generation. I would like to ask Hibernate authors if this is somehow my fault or is this a symptom of a bug in Hibernate. Is short: there is a 'User' entity, it contains component 'Address'. Address is associated to the entity 'Country'. Country contains map of elements. I create HQL query as ...

6. STOP one-to-one join extra query generation    forum.hibernate.org

Newbie Joined: Tue Aug 28, 2007 3:18 am Posts: 13 Hi I have 4 table.Namely - Tkt,BoxTkt,CusipTkt and TktAudTrl. Tkt has 1-1 relationship with both BoxTkt and CusipTkt. Tkt has 1- many relationship with TktAudTrl BoxTkt and CusipTkt have share the same primary key of Tkt. Now when I want to perform this following hql : from TktAudTrl at join at.tkt ...

7. HowTo generate a value by the DB like NOW().    forum.hibernate.org

8. SELECT count generates UPDATE statements on oracle    forum.hibernate.org

This happens on hibernate 3.2.6, and older versions as well When running on Oracle9Dialect, with an Oracle10G DB, Hibernate generates UPDATE statements in cases where we simply send SELECT and SELECT count() statements. This only happens on Oracle. MySQL does not do that. I can provide the generated SQL statements, but before I do that (they are huge), is there an ...

9. session.save generates unnecessary(?) SELECT before INSERT    forum.hibernate.org

Hi, this is what I believe is going on: you are trying to save a City object by providing a transient Country object with its identifier set. Since you have defined in your .hbm files a unidirectional many-to-one association, hibernate, in order to maintain the integrity of the association, must somehow verify that this object you are passing is indeed a ...





10. Can repeated columns in generated SQL queries be avoided?    forum.hibernate.org

Author Message enielsen Post subject: Can repeated columns in generated SQL queries be avoided? Posted: Tue Apr 22, 2008 6:48 am Newbie Joined: Mon Apr 21, 2008 4:47 am Posts: 1 Hi, we started watching the generated SQL and noticed that sometimes the same columns are mentioned twice in the queries, like ref_a_id and id_b in this example: Code: ...

11. HQL generates but Hibernate can not find View!    forum.hibernate.org

My Hibernate generate query from HQL but cannot find view!!! I can executed query easily and gain result manualy but Hibernate can't!!! I have too many other entities that mapped to other tables or views and too many HQL query that work well and this query does not have any different from others. Just I changed my DB from oracle 9i ...

13. Tell hibernate not to generate bound queries    forum.hibernate.org

14. Update queries generation bug    forum.hibernate.org

...

15. Add a "pass-through" clause to all generated SQL?    forum.hibernate.org

We're using Hibernate 3.1.3 to access a Connx ( www.connx.com ) database. For reasons I won't go into, we need to add a Connx-specific clause to every generated SQL statement - INSERTs, DELETEs and UPDATEs as well as queries. The clause is in the format: { fn setfilename , '' } for example: { fn setfilename customer, '/data/branch/ST/STcustomer' } (The curly ...

16. Call Oracle function on generated native SQL query    forum.hibernate.org

Hi all, I'm trying to figure out how to do the following thing. We have implemented new search functions with Lucene and Hibernate. Our search query is very complicated and is generated by Hibernate with lot of detached criterias, etc. When we use paging (display up to XX results on one page), it works pretty well. But when we to want ...





17. Hibernate generate select while storing object.    forum.hibernate.org

Newbie Joined: Thu Dec 04, 2008 7:00 am Posts: 4 Hi, Here we are using JTA transaction and Ehcache, first we are taking TransactionManager instance to manage the transaction across different sessions, then we have single instance of SessionFactory instance through which we are taking instances of Session Object, here we are taking Different Session object to store each object , ...

18. SQL Query generated by HQL doesnt include the newly added db    forum.hibernate.org

I have a working HQL as mentioned below String queryStr = "from X x left join fetch x.y y" + " left join fetch x.z z" + " left join fetch x.a a" + " where x.y.id = ?"; I added a new column called threshold to the table X_TABLE (which is mapped to POJO X) The sql generated from the ...

19. saveOrUpdate only generates select query, no insert or updat    forum.hibernate.org

Hi All, I am trying to save a object using saveOrUpdate. I have set show_query to true and I see all the executed queries in my website log. When saveOrUpdate is executed, I see a select statement in the log but no update pr insert command. The select statement is executed to see if the object exists in the database. I ...

20. Query failing, strange SQL generated from HQL    forum.hibernate.org

Hibernate version: 3.2.4 sp1 (packaged with JBoss 4.2.2 GA) Mapping documents: Code: ...

21. find() generates 1 query but createQuery() generates 3    forum.hibernate.org

Hibernate version: 3.3.1 Name and version of the database you are using: Derby Embedded false true true 5 table XCPTN has two Many-To-One relationship with FIRM_REF and XCPTN_TYPE if I run query this way: Code: Xcptn x = em.find(Xcptn.class, 1000L); There is only ONE query: Code: select xcptn0_.ID as ...

23. Query not correctly generated when using setMaxResults    forum.hibernate.org

Hi all, This is my first post in this forum and i hope this is the right place to do it. I've been searching all over the web, but i couldn't find anything significantly similar to my problem. This is the peace of code that i'm using to submit the query: Code: public List findExtendedBlogEntries( int max ) throws SystemException { ...

24. Hibernate is generating invalid queries    forum.hibernate.org

Newbie Joined: Wed Jun 06, 2007 9:14 am Posts: 12 - Hibernate 3.3.1.GA - Hibernate Annotations 3.4.0.GA - Hibernate EntityManager 3.4.0.GA - MS SQL Server 2000 Hello, everybody! I'm upgrading from Hibernate 3.2.4.sp1 to Hibernate 3.3.1.GA . Now, when I execute the following query (that worked in Hibernate 3.2.4.sp1 ): Code: String nome = (String) em.createQuery( "SELECT ...

25. Generated query containing duplicate columns    forum.hibernate.org

I am facing a issue with the query generated by hibernate to load from database. SELECT THIS_.ID AS ID25_1_, THIS_.NAME AS NAME25_1_, OFFICES2_.LEGAL_ENTITY_ID AS LEGAL3_3_, OFFICES2_.ID AS ID3_, OFFICES2_.ID AS ID27_0_, OFFICES2_.NAME AS NAME27_0_ FROM CUSTOMER_MASTER.LEGAL_ENTITIES THIS_ LEFT OUTER JOIN CUSTOMER_MASTER.OFFICES OFFICES2_ ON THIS_.ID = OFFICES2_.LEGAL_ENTITY_ID Why is hibernate generating query with duplicate reference to offices2_.id ? My hbm file for ...

26. Query returns no value although generated sql does    forum.hibernate.org

Newbie Joined: Mon Sep 07, 2009 5:23 am Posts: 2 I run the following code: Code: String query = String .format("select ti from com.emi.framework.infrastructure.workflow.EmiTaskInstance as ti, " ...

27. Hibernate is not generating proper queries with MySQL    forum.hibernate.org

I am changing configuration of hibernate 3.0 from MSSQL to MySQL. This is done but Hibernate is not generating proper queries for MySQL. I have also updated my configuration file with MySql dialect and Mysql jdbc connector. The problem i am facing here is -- I have one table only with PK with one more column(FK of other table). Now while ...