sql 2 « SQL « JPA Q&A





1. SQL Casing    forum.hibernate.org

Hi All, Im trying to access an IBM UniVerse database using hibernate. But universe is case sensitive and the sql that hibernate generates is in lower case, but what is required is that the casing must be preserved for table names and column names. Example: UniVerse will not accept (which what hibernate generates): select tbl_clients0.id, tbl_clients0.name from tbl_clients tbl_clients0; But will ...

2. Changing with callable="true" beh    forum.hibernate.org

3. Use Hibernate with Non-SQL Legacy Datastore?    forum.hibernate.org

Is there a possibility to use Hiberante with a non-SQL capable datastore? I'm working in a project where the database access occurs by transfering XML documents between our application and a proprietary datastore. The datastore supports some very basic functions of a RDBMS: - select, insert, update, delete on tables - filtering with boolean operators (where clause) - sorting Examples of ...

4. Subselect not compiling into SQL    forum.hibernate.org

Author Message topping Post subject: Subselect not compiling into SQL Posted: Fri Jun 16, 2006 5:53 am Newbie Joined: Mon Sep 01, 2003 9:48 pm Posts: 17 Greetings, I'm working on a Dialect for PostGIS and am running into a problem. So far, I've been relatively successful at getting a Dialect that SchemaUpdate can generate the correct database from, ...

5. Sql Parser in AST Form    forum.hibernate.org

Looking at Hibernate documentation I found something wich can be usefull for me in differente environment. I noticed You have some classes wich translates HQL query to SQL query creating an Antlr compatible AST. I need to know if there is some classes wich create an AST form for a generic Sql query. It would be usefull for me in order ...

6. Hibernate 3: Custom SQL    forum.hibernate.org

Thanks max. I haven't done the test yet. I still have one question: How does Hibernate know the right order of the parameters? Because in the mapping file we just use quesion marks to describe the stored procedure. How does hibernate know which question mark represents which field? (BTW: I won't forget to rate :) )

7. SQL output in console?    forum.hibernate.org

Hi everybody, i 've got the following configuration properties in mycfg.xml. When i persist an object to the database i expect to see some sql output in my console? Is that a correct expectation? Code: true true true What i am trying is to see why my code does not insert a new record to the database (Oracle ...

9. Hibernate and SQL Everywhere (aka SQL Mobile)?    forum.hibernate.org





10. SQL help    forum.hibernate.org

Hello, I have three simple tables PRODUCT id name manufacturer FEATURE id name sortorder PRODUCT_FEATURE id product_id feature_id value I am trying to build a search based on Product name and manufacturer and a feature value, where feature sql should be something like ((feature_id=1 and value in ("V1","v2") and (feature_id=2 and value in ("V1","v2")) When a single feature select executed it ...

11. hibernate with sql    forum.hibernate.org

12. hibernate with sql    forum.hibernate.org

Newbie Joined: Thu Oct 26, 2006 11:35 pm Posts: 3 Location: India i'm using hibernate with sql and a stand alone java application when i'm running the application it is creating the configuration object and after wards when it is trying to create sessionfactory object it is giving me an error like 23:56:32,980 INFO Environment:479 - Hibernate 3.1.3 23:56:32,996 INFO Environment:509 ...

13. Hibernate says its run sql sttmnt but nothing goes in hsqldb    forum.hibernate.org

Hi ! I'm having some problems with the example located under hibernate3.2/docs/tutorial/src I can get it working with a mysql database with no problems, but i want to get hibernate working with a hypersonic sql database it creates as needed.. whenever i run the example configured to use a hypersonic db with the connection url jdbc:hsqldb:file:./db hibernate says it runs the ...

14. dynamic sql    forum.hibernate.org

I have a class: [code]public class UserAll extends User { private [b]Employer[/b] employer = null; private [b]Collection[/b] roles = new LinkedList(); private [b]Collection [/b]groups = new LinkedList(); public UserAll() { super(); } public UserAll (long id) { super(id); } /* setters / getters below */[/code] I have a search screen which has the name, employers, groups and roles that we allow ...

15. SQL Hints .. How is this done ?    forum.hibernate.org

16. SQL / Hibernate synchronisation    forum.hibernate.org

Dear all I read always that it is easily to execute native SQL with Hibernate. Am I forced to always use Session.createSQLQuery() or can I use straight forwad java.sql.* classes like PreparedStatement.execute() ? Or will this lead to synchronisation problems if I try to use both (native SQL and Hibernate) to insert and retrieve objects from the DB? Would there be ...





17. Extra sql calls?    forum.hibernate.org

Hi, I'm new to Hibernate and have a basic question. I create a new object, call some setter methods and save it in the session using session.saveOrUpdate(entity). After that, I don't commit the session immediately but continue modifying values for entity. eg: entity.setEmployeeNumber(399); entity.setEmployeeType("Supervisor"); session.saveOrUpdate(entity); entity.setEmployeeNumber(599); entity.setEmployeeType("New Worker"); session.saveOrUpdate(entity); transaction.commit(); I notice at commit time, hibernate calls 2 sql calls: Hibernate: ...

18. Using direct SQL in hibernate.    forum.hibernate.org

Hi, I am trying to use a direct sql query using a prepared statement as follows in hibernate. Session session = HibernateUtil.getSessionFactory().openSession(); Transaction tx = session.beginTransaction(); try { PreparedStatement preparedStatement = session.connection().prepareStatement("select * from messagerecipients where name = ?"); preparedStatement.setString(1, "\'first recipient\'"); ResultSet resultSet = preparedStatement.executeQuery(); while(resultSet.next()) { System.out.println("Got :"+resultSet.getString(1)); } preparedStatement.close(); }catch(SQLException ex) { System.out.println(ex.getMessage()); throw new RuntimeException(); } tx.commit(); ...

19. ASTQueryTranslatorFactory and SQL "having"    forum.hibernate.org

Test Code String HQL = "select coupon.id " + " from Participation as prtc " + " join prtc.parentGame as game " + " join game.parentCoupon as coupon " + " join game.templateGame as templateGame " + " join templateGame.gameState as gameState " + " where coupon.couponStatus = :cpnStatus " + " and gameState.mainGameCode in (:mainGameCodes) " + " and (game.firstDraw ...

20. Automatic SQL execution    forum.hibernate.org

Hi All, I've the a problem: I need to update a field ind DB that exists in all my tables (an infrastructural DB column it is UPDATE_USER_ID) under the following conditions: 1) All my persistent classe MUST NOT to have a property mapped to this column 2)Every time I execute an Inset or an update on every persisted class I MUST ...

21. SQL requirements    forum.hibernate.org

If you have a quality JDBC driver then the target database can work with Hibernate. All that is required from there is an appropriate dialect (as batmat has indicated). Most likely there is one already for the database of choice but if not then it is easy enough to create one (as there is lots of example to look at).

22. Hibernate USER (SQL)    forum.hibernate.org

Hello hibernaties, I am new for hibernate. So please share your knowledge to solve my probs. I am trying to create database using hibernate so any one who know about this please reply to me. My question?????// Using hibernate can we create new schema or database please let me know about this topic. If you know then how plese tell me..........let ...

23. SQL-92 or SQL-99    forum.hibernate.org

24. How to suppress the Sql warnings    forum.hibernate.org

25. How can I get SQL text when using Hibernate    forum.hibernate.org

I am using hibernate for persistence data, but unfortunatelly I had to save the data by myself for my special project. Every save/update/delete operation I should get the SQL and save them to the text files. And I have two problems: 1. How can I get the SQL from Hibernate.Session.save / update / delete in application? The option true just control ...

26. How do i do the next sql consult?    forum.hibernate.org

27. Behaviour of 1. and 2. level caches when using custom SQL    forum.hibernate.org

Hibernate version: 3.1.3 Name and version of the database: MySQL 5.0.24a Hi everyone, I want to optimise the performance of complex delete operations (across several tables) by executing custom SQL code using a Hibernate session. I am using first and second level caches. How would a custom delete operation affect these caches since I am "bypassing" HQL and SQL code generated ...

28. How to enable precise Hibernate SQL    forum.hibernate.org

29. SQL in Hibernate    forum.hibernate.org

We're using Hibernate in our project, but we eventually found out that some kinds of queries were too complicated for it. So, after studing a bit the Hibernate in Action book and the documentation chapter about SQL, I tried to use SQL queries in our project. Anyway, Direct SQL queries work ok, but I'm having problems with the placeholders scheme. Actually, ...

30. help translating SQL to EJBQL in case of a many2many    forum.hibernate.org

Hibernate version: 3.3.2 Name and version of the database you are using: Oracle 10g Three entities - fof, fund & fundPerformance. Fof (owning entity) has a Many2Many with Fund fundPerformance has a uni directional OneToMany to Fund. Basically, fund Performance is tracked for a fund, every month and that fund can belong to one or many Fofs. I need to get ...

31. Hibernate in a SQL blog    forum.hibernate.org

32. Can i got SQL statistical Information from hibernate    forum.hibernate.org

Hibernate version: 3.1.rc3 Hi, In my application when i enable show_sql = true i found that number of sql generated by Hibernate for particular sql is really huge, so i though if Hibernate provides input of statistical info of SQL? like how many sql it execute for particular period of for specific HQL farther more if hibernate registers overall number of ...

33. Dynamic SQL populating the same Java Class    forum.hibernate.org

Hi I have requirement where my Select queries changes to different tables to fetch key and value. I am using the same class(TempVO) with attributes key and value for all queries. For each time when the query changes it fetches two fields from the corresponding table one is key and the other is value. I appreciate any help on this. Thanks ...

34. hibernate and maping and sql    forum.hibernate.org

Hi Every one! can anyone describe when i have to to choose the hibernate mapping and when i have to use the hql. and can i use hibernate mapping in all cases, i mean if i want to use where, order and so on in a statement.... I have a simple question too. if i have some like this query select ...

35. How to replicate this SQL querry    forum.hibernate.org

Hi Cameron McKenzie, Thanks for your input. I am new to Hibernate so i dint try new ways. I did the following and landed in Exception. (A)I got my objects mapped, (B) I tried to use the usual SQL like querry structure to feed the Hibernate. I did something like this.... Query selectQuery = session.createQuery("select main.id from (select distinct fc.function , ...

36. populating instance variables based on sql    forum.hibernate.org

Newbie Joined: Fri Sep 26, 2008 6:20 am Posts: 4 This is an example of how our Delphi developers pull some bits of the licence details and vehicle details of an operator. I'm designing a model to suit an existing database, so i don't have a lot of room Code: Select lic_id, lic_numb, veh_id, Veh_reg_no, veh_no_passengers from Licences left outer join ...

37. HibernateJdbcException: SQL command not properly ended    forum.hibernate.org

Newbie Joined: Fri Dec 07, 2007 5:02 am Posts: 4 Location: Haugesund, Norway Hi. We're using Quartz scheduling engine for synchronisation between external data and into our application. The query run by the scheduled jobs encounter an exception when ran from our weblogic production server, but not from my localhost. I get an SQLException: SQL command not properly ended in production. ...

39. Hibernate hangs while raw SQL is fine    forum.hibernate.org

Newbie Joined: Fri Jan 26, 2007 9:46 am Posts: 6 Hi, Here is the point... We are currently using Hibernate 3.2.3GA above Oracle10g (release2). Playing with criterias I'm ending up with the following SQL line (thanks to hibernate.show_sql): select count(*) as y0_, min(this_.CREATION_TIME) as y1_, max(this_.CREATION_TIME) as y2_, count(distinct this_.REFERED_ID) as y3_ from XXXXXX.NPO_LOG_EVENT this_ inner join XXXXXX.NPO_LOG_REQUEST eventreque1_ on this_.LOG_REQUEST_ID=eventreque1_.ID ...

40. sub class sql issue    forum.hibernate.org

41. many-to-one and resulting sql output    forum.hibernate.org

42. Calling sql script from hibernate3 does not work.    forum.hibernate.org

Hello, I have a sql function uGetSeq() which returns an incremental alphanumeric value. I want to call it from my web application which is based on Hibernate3 and Struts. I created a NamedQueries.hbm.xml and I put it into the place where all other hbm.xml files are located too. NamedQueries.hbm.xml: