select 2 « Query « JPA Q&A





1. Enormous amount of select queries    forum.hibernate.org

Hello I am using Hibernate and I noticed alot of select queries showed up where it is not necassary. Code: 007-07-13 14:32:13 LOG: duration: 0.000 ms statement: select accessrigh0_.accessright_id as accessri1_6_0_, accessrigh0_.accessright_name as accessri2_6_0_ from accessright accessrigh0_ where accessrigh0_.accessright_id=46 2007-07-13 14:32:13 LOG: duration: 0.000 ms statement: select accessrigh0_.accessright_id as accessri1_6_0_, accessrigh0_.accessright_name as accessri2_6_0_ from accessright accessrigh0_ where ...

2. Union select in query ignored?    forum.hibernate.org

3. how many selects for one viewpage?    forum.hibernate.org

I have a question about the number of selects in a viewpage. For example We have an auction site similar like ebay. When the user clicks a parent category, the following view is returned. A page that shows all the subcategories with the total number of items in it and the most interesting items in these sub categories. Then a banner ...

4. Select Query    forum.hibernate.org

I need to query a table having data similar to something like: Date Count 1/10/2007 10 2/10/2007 13 4/10/2007 11 6/10/2007 12 Notice that there is no data avaialble for 3rd and 5th; I expect the result to have something as shown below: Date Count 1/10/2007 10 2/10/2007 13 3/10/2007 0 4/10/2007 11 5/10/2007 0 6/10/2007 12 This is not possible ...

5. Select using CUBE/ROLLUP    forum.hibernate.org

I have a branch offices all over india: Chennai, Delhi, Calcutta and Mumbai. In each of these locations I have various employees with different designations like supervisor, manager , branch manager and boss. Say employee table is like id, name , city , designation Assume (Only if required)Say all designations are stored in a table: id, designation I need to query ...

6. Select Query - Cubes    forum.hibernate.org

Hi All, I need to query a set of tables; and aggregate the data on a given frequency; say eg DAILY. But the at database level, there will be instances where there are no records for a given day; In such a scenario I should be diaplaying count as zero against the date. I tried using Cube/Rollup but its partly solving ...

7. suppressing Hibnernate: select ...etc....    forum.hibernate.org

I have a number of console programs I need to write for mainframe - to sql updates and extracts. When I run a sample program for a sql table read / display, I'm able to suppress all the: Hibernate 3.2.0.ga loaded properties from resource hibernate.properties: using java.io streams to persist binary types ....etc..... messages using log4j, but I'm still getting the: ...

8. one-to-many selects but doesn't assign?    forum.hibernate.org

Hello, Ran out of ideas what may be wrong, please help. Hibernate 3, one-to-many relation: I can see in the log that hibernate selects children (and the query returns what expected) but the Collection property in the parent object is still empty. Would appreciate any hints as it has been a few days and I just have no single idea left. ...

9. many-to-one select behavior    forum.hibernate.org

Newbie Joined: Mon Mar 03, 2008 9:31 pm Posts: 4 Hibernate version: 3.2.1 Mapping documents: Code: SEQ_ADDRESS ...





10. Collation selection in HQL?    forum.hibernate.org

Hi I have a problem with the sorting of data in my database. We have several different customers in several different countries and each of these countries have different sorting. The following specs on the system: Hibernate: 3.2.0.GA Application server: Jboss 4.0.5.GA (EJB3) Runtime: Java 1.5 Database: MySQL 5.0.45 Operationsystem: Linux What I would like to accomplish is a way of ...

11. Select in select with Criteria    forum.hibernate.org

Hi, how can I make a query like this with Criteria? Code: select v.idEstabelecimento, v.nomeEstabelecimento, (Sum(valorVenda) as totalVenda), (select (sum(quantidade) from Vendas v1 where (v1.idEstabelecimento = v.idEstabelecimento ...

12. Strange behaviour from SQLQuery with selecting from a view    forum.hibernate.org

Hi, I am running a SQLQuery which consists of selecting out of a view. When the query executes it shows sql that is actually doing an update when it fails. One of the fields that it is trying to update is null, this is the reason that the failure occurs. Why would in selecting from a view try to do an ...

13. Simple "SELECT *" by criteria    forum.hibernate.org

Please check the SQL generated for the subselect and post it When i do a createQuery("from SomeEntity").setMaxResults(10) The SQL will be like SELECT ID FROM SOME_ENTITY_TABLE where rownum <=10 Then i access a collection of SomeEntity that is mapped with subselect the SQL will read something like SELECT FROM ENTITY_COLLECTION_TABLE WHERE ENTITY_ID IN (SELECT ID FROM SOME_ENTITY_TABLE) Not including the rownum ...

14. Hibernate issuing additional SELECT    forum.hibernate.org

Newbie Joined: Wed Feb 04, 2009 5:27 pm Posts: 1 I'm doing a read of base table which only returns one result. This is fine and exactly what I want. However, I have an additional history table that needs to be queried using a separate method all together, but still using the same service. This history table is almost an exact ...

15. 200 select if one    forum.hibernate.org

16. do "select now()" in hql    forum.hibernate.org





17. diacritic insensitive select    forum.hibernate.org

Hi, is any way for write HQL query which is diacritic insensitive? I can write native SQL, but it is only for one database (Oracle for example - upper(convert(column_name, 'US7ASCII')) like upper('%pattern%')). In HQL propably it isn`t such way without some additional function. Could I write some function which can be used during generation SLQ from HQL and there substitute for ...

18. StaleStateException on Select    forum.hibernate.org

I have an interesting problem. I recently added a column to my mapping file, updated the subsequent class file and now when I select that entity, I get the following an exception, but only on our staging Jboss server. I dont get the exception locally. And if I remove the new entry from my mapping file I dont get an exception. ...

19. Timout when many selects executed    forum.hibernate.org

Newbie Joined: Wed Feb 13, 2008 6:38 am Posts: 5 Location: Germany - Leipzig I work with Hibernate and Spring. I have written following code. Code: return (CurrentStatus) getHibernateTemplate().execute(new HibernateCallback() { ...

20. HQL select from (select ...)    forum.hibernate.org

I finish some selections with hibernate criteria but now that criterias need to work with big collection of data. I found better sql query which is faster than converted previous query bat here is problem. How to convert that sql query to hql. Database : MYSQL SQL query example: create sub table with inline view and afther that get other related ...

21. Simple select    forum.hibernate.org

22. Hibernate Select Query    forums.oracle.com

Its good to stop this conversation here, The sql query is working like a charm , with no problem, I can not post all my classes to you to see what is right and wrong. the select statement that I wrote there, its a kind of hint, the variable names are not the real name, I just want the forum to ...