sql 1 « SQL « JPA Q&A





1. What are "SQL-Hints"?    stackoverflow.com

I am an advocate of ORM-solutions and from time to time I am giving a workshop about Hibernate. When talking about framework-generated SQL, people usually start talking about how they need to ...

2. How to escape SQL keywords in JPAQL    stackoverflow.com

I would like to have an entity named "GROUP" in my JPA setup. Now I get problems when I try to perform JPA queries, like "select count(group_.id) from Group group_". JPA ...

3. bi-directional o2m/m2o beats uni-directional o2m in SQL efficiency?    stackoverflow.com

Use these 2 persistent CFCs for example:

// Cat.cfc
component persistent="true" {
  property name="id" fieldtype="id" generator="native";
  property name="name";
}

// Owner.cfc
component persistent="true" {
  property name="id" fieldtype="id" generator="native";
  property name="cats" type="array" fieldtype="one-to-many" ...

4. hibernate show real sql    stackoverflow.com

if I set

<property name="show_sql">true</property>
in my hibernate.cfg.xml configuration file in the console I can see the sql. But it's not REAL sql... Can I see the SQL code that will be passed directly ...

5. hibernate restrictions.in with and, how to use?    stackoverflow.com

I have table like below

id, employee_no, survey_no, name
1    test          1         test_name
2 ...

6. Will hibernate java programs have no sql code?    stackoverflow.com

I haven't worked with hibernate. I have little bit of experience in java. I was going through source of a beast of an java application created by Oracle(Retail Price Management). I ...

7. How to define many-to-many to itself in JPA?    stackoverflow.com

I'm trying to define this SQL schema in JPA:

TABLE event (id INT)
TABLE chain (predecessor INT, successor INT)
In other words, every event has a number of successors, which are events themselves. I'm ...

8. How do I show SQL with Play Framework?    stackoverflow.com

I have a Play app that uses a database, and for debugging purposes I want to show the SQL that JPA uses. How can I do this?

9. Hibernate authentication without passwords stored in plain text    stackoverflow.com

My goal is to authenticate to the database using a JDBC/Hibernate in a secure manner, without storing passwords in plain text. Code examples appreciated. I'm already using waffle to authenticate the ...





10. CheckBoxMultipleChoice store in SQL    stackoverflow.com

I am using the wicket 1.3 CheckBoxMultipleChoice() method to have the user select relevant teams for a project. When I store the team list to the database it gets stored ...

11. Setting up maven dependency for Microsoft SQL    stackoverflow.com

I am developing a portlet where I have Hibernate access to Microsoft SQL Database Server. I set up maven dependencies for it and try to find out MS SQL connector on ...

12. static SQL doesnot work in HSQLDB    stackoverflow.com

i am using HSQLDB for storing purpose and Java and hibernate as middleware. I am some named queries (SQL) in my HBM files. When i try to execute those queries they ...

13. How can I work-around this Hibernate Limitation?    stackoverflow.com

I have 3 entities in a Hierarchy like this:

         MyInterface
              ...

14. Hibernate sql tranformation    stackoverflow.com

I have an SQL statement with the names of the class instead of the names of the tables. Then I use a ResultTransformer to map the result in a bean, but Hibernate ...

15. Hibernate vs SQL    stackoverflow.com

I'm currently implementing a new functionality to a tool in an e-learning platform. I need to retrieve some columns from 3 different tables in the database. The particular tool is implemented ...

16. Q 4 C. Bauer & G. King (4): Hibernate SQL rule base?    coderanch.com

3.5.1. SQL Dialects You should always set the hibernate.dialect property to the correct net.sf.hibernate.dialect.Dialect subclass for your database. This is not strictly essential unless you wish to use native or sequence primary key generation or pessimistic locking (with, eg. Session.lock() or Query.setLockMode()). However, if you specify a dialect, Hibernate will use sensible defaults for some of the other properties listed above, ...





17. Dynamic sql with hibernate    coderanch.com

Is something like possible with hibernate In other words i want to selectively pick columns i want and which are not necessarity defined in the .hbm mapping file. The .hbm has only the key columns. .hbm has The table in question is big with lots of columns. ...

18. Help, how config Hibernate to show the real SQL?    coderanch.com

No luck, I still get the same thing. Here is my log4j.properties, is there something wrong with those parameters? ========================================= ### direct messages to file hibernate.log ### #log4j.appender.file=org.apache.log4j.FileAppender #log4j.appender.file.File=hibernate.log #log4j.appender.file.layout=org.apache.log4j.PatternLayout #log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n ### set log levels - for more verbose logging change 'info' to 'debug' ### log4j.rootLogger=warn, stdout #log4j.logger.net.sf.hibernate=info log4j.logger.net.sf.hibernate=debug ### log just the SQL #log4j.logger.net.sf.hibernate.SQL=debug ### log ...

19. Combine Hibernate with hand-coded SQL    coderanch.com

Hello, Our current application architecture exists of a Session Faade (SLSBs) which dispatches requests to one or more local business objects (SLSBs). These business objects communicate with data access objects (DAOs) trough fine-grained interfaces. The data access objects are hand-written and contain SQL statements and calls to stored procedures (a Data Access Helper is used to abstract the low-level JDBC tasks). ...

20. apostrophe ( ' ) issue in SQL of Hibernate.    coderanch.com

Hi GUys I am facing a problem in my SQL query..when I use apostrophe (') Explaination: I want to search Java's in the search crieteria so my SQL looks like I used java's in my search textbox and following broblem is created in the QUERY: sql= select distinct project from Project as project where project.projectStatus.projectStage = 1 and ( project.deleted is ...

21. hibernate.show_sql    coderanch.com

The definition for this property is: Write all SQL statements to console (a minimal alternative to the use of the logging functionality as described in Chapter 10) Anyone have a recommendation of how I can get all sql statements to write to a log file instead of a console? The console logging works fine when I am running the application locally ...

22. Hibernate is not recognizing SQL's 'FREETEXT' keyword    coderanch.com

I'm trying to execute a search query with hibernate and the query is failing because hibernate does not recognize MS SQL Server's keyword "FREETEXT". Select S.serviceId from ServiceCbo S where FREETEXT(S.serviceName, '" + userInput + "') I've been struggling use this for DAYS!! and there are not any information online regarding this keyword.

23. sql driver with hibernate    coderanch.com

public String populateAction() throws SQLException, NamingException{ Transaction tx = null; Configuration cfg = new Configuration().configure("./hibernate.cfg.xml"); cfg.addResource("./hibernate.cfg.xml"); SessionFactory sessionFactory = cfg.buildSessionFactory(); Session session = sessionFactory.openSession(); //Session session = InitSessionFactory.getInstance().getCurrentSession(); try { tx = session.beginTransaction(); session.save(this.testRun); session.save(this.testLane); tx.commit(); session.close(); } catch (HibernateException e) { e.printStackTrace(); if (tx != null && tx.isActive()) tx.rollback(); } return "test2" ; }

24. Hibernate SQL    coderanch.com

Hi, I am very much new to hibernate and please do excuse me if this question sounds very generic and have been asked million times. I would appreciate if you could help me understand or point to an old topic related to it. Thanks in advance. I am writing a sample hibernate query and want to display the sql in my ...

25. Can i get only the SQL commands from hibernate?    coderanch.com

Hey, I have a root object (TransactionEvent) that have referened to a lot of other objects and etc I get around 100 TransactionEvent objects per sec. I need to save the toor entities and all the related entities to the DB. The save is simple cascade save without merge. I am pretty sure that hibernate will not be able to support ...

26. Hibernate 3 not able to recognize the "ON" word in sql    coderanch.com

String select ="select v.description ,p.productNumber, r.vendorItemNumber, p.description," + " ISNULL(i.InventoryAmount, 0) from Products p JOIN Racks r " + " on p.productNumber = r.productNumber JOIN RacksVendors v on r.vendorID = v.vendorID " + " LEFT JOIN Inventory i on p.productNumber = i.productNumber JOIN Brands b" + " on p.brandID = b.brandID List query_select = null; query_select = session_hibernate.createQuery(select).list();

27. Creating filtered SQL indexes via Hibernate    forum.hibernate.org

This could be done, but it would require a couple of code changes that are pure concessions to SQL Server (and maybe Sybase, but I don't know if this is a function of Transact-SQL or just Microsoft's version of it). First, the Dialect interface would need a new boolean isFilteredIndexSupported() method. Second, a new SqlServer2008Dialect would need to be created that ...

28. Hibernate 3 not able to recognize the "ON" word in sql    forum.hibernate.org

SELECT V.Description AS Vendor, P.ProductNumber, R.VendorItemNumber, P.Description, ISNULL(I.InventoryAmount, 0) AS InventoryAmount, ISNULL(I.ThresholdAmount, 0) AS ThresholdAmount FROM tbProducts P JOIN tbRacks R ON P.ProductNumber = R.ProductNumber JOIN tbRacksVendors V ON R.VendorID = V.VendorID LEFT JOIN tbInventory I ON P.ProductNumber = I.ProductNumber Join tbBrands T ON P.brandid=T.brandid order by ...

30. java.sql.SQLInvalidAuthorizationSpecException: invalid autho    forum.hibernate.org

Newbie Joined: Thu Apr 01, 2010 9:20 am Posts: 4 Hi, I'm trying out the example in the below link http://www.vaannila.com/hibernate/hiber ... ons-1.html I'm getting the following error. Could anyone please help me in solving this problem. Code: Apr 5, 2010 11:23:55 AM org.hibernate.cfg.annotations.Version INFO: Hibernate Annotations 3.2.0.GA 62 [main] INFO org.hibernate.cfg.Environment - Hibernate 3.3.0.SP1 78 [main] INFO org.hibernate.cfg.Environment - ...

31. onetoone with referencedColumnName, weird SQL    forum.hibernate.org

Please take a look at the SQL created; it works but seems partly redundant: Code: [DEBUG,SQL] /* load org.hibernate.test.annotations.onetoone.referencedcolumnname.H */ select h0_.id as id0_2_, h0_.objId as objId0_2_, h0_.value as value0_2_, ...

32.     forum.hibernate.org

33. 17.3 Custom SQL - documentation old and/or wrong    forum.hibernate.org

34. too many sql    forum.hibernate.org

I have this: And i ...

35. sql formatter    forum.hibernate.org

Quote: I posted this message into "hibernate tools" but I was told it is a hibernate-core problem: SchemaExport does not respect format from entered input. Statements coming from xml file are generated into database as a whole line. No way that they are perfectly formatted. Statement entered: Code:

36. N+1 sql issue    forum.hibernate.org

I'm having a N+1 SQL issue with the below setup. I'm not sure how to fix it. I researched on internet and also looked the relevant posts in this forum but I couldn't figure it out how to fix this. // Snippet DetachedCriteria criteria = DetachedCriteria.forClass(Group.class); criteria.setFetchMode("members", FetchMode.JOIN); criteria.add(Property.forName("usageType").in(usageTypes)); criteria.getExecutableCriteria(...) // ENTITY setup @Entity @Table(name = "GROUP", schema = "XYZ") public ...

37. When to shift from Hibernate to direct use of SQL?    forum.hibernate.org

I have a general question on the realistic constraints of using Hibernate for complex multi table queries versus using Hibernates own search mechanisms. My Spring web app uses Hibernate to map all the entities and for simple CRUD operations or one/two/three table queries and master/detail associations this works fine. However, I've now started to add some quite complicated reporting facilities to ...

38. cirrus.hibernate.sql.DB2Dialect not found    forum.hibernate.org

39. Raw sql in Hibernate 2.0.3    forum.hibernate.org

Thanks christian. Guess will have to go that route? But here is another question, I am trying to send a query to the database (MSSQL Server) and I want to add a string to my query. Say I have the following query: Select * from myTable where name like '%na%' I want to send this down to the database as the ...

40. RAW SQL with Hibernate    forum.hibernate.org

Hi, I tried a very simple query using createSQLQuery() but got invalid column name, what can be wrong? select * from CM_CONTRACT_SHORTCUT [WARN] JDBCExceptionReporter - -SQL Error: 17006, SQLState: null [ERROR] JDBCExceptionReporter - -Invalid column name [WARN] JDBCExceptionReporter - -SQL Error: 17006, SQLState: null [ERROR] JDBCExceptionReporter - -Invalid column name [ERROR] JDBCExceptionReporter - -SQLException occurred java.sql.SQLException: Invalid column ...

41. viewing sql    forum.hibernate.org

42. hlq and my sql regexp    forum.hibernate.org

Hi, I am new to hibernate and currently using Mysql as my database. I want to write a hlq to search product by keywords using mysql regexp and the queryString i have is FROM Product as product where p.description REGEXP '[[:<:]]keyword1[[:>:]] and product.description REGEXP '[[:<:]]keyword2[[:>:]] ... (Similar SQL statement works fine in plain JDBC) And I got the following exception from ...

43. Customized SQL usage    forum.hibernate.org

hi folks, am i enable to generate my customize sql and add to the session to allow commit at a single point with others generated by hibernate? and is there a way to get all generated sql from the session as if it havent flush or commit yet? Thank for the help... regards, K

44. Are SQL Procedures supported?    forum.hibernate.org

Hi All. I am using Hibernate 2.0 currently. To the best of my knowledge it does not support SQL procedures. I remember reading that one of the later version of Hibernate support SQL Procedures. Could you please help to verify the information. If not, are there plans to support SQL Procedures in future versions. Your help is greatly appreciated. Regards.

45. .:: Sql messages into console    forum.hibernate.org

46. Trapping plain SQL programmatically in Hibernate    forum.hibernate.org

Hi, show_sql true prints the query on the console. I found where it was doing it in the Hibernate source - but am still figuring out how to extract the query which is being printed on the console - basically I want the SQL (not HQL) which hibernate is firing for doing a select. I want to store it somewhere in ...

47. Hibernate issues with my SQL    forum.hibernate.org

I am having issues with Hibernate and my SQL this problem doesn't occur until a certain ammount of select / update statements is reached. Whenerver a certain limit is reached hibernate is giving me a null pointer error. Also I made 100% sure that its not an error in the method I created since this is just a simple hibernate statement..... ...

48. lowercase conversion creates problematic SQL with Turkish    forum.hibernate.org

Hi, New to Hibernate, Have a feeling like it's the next big thing after Java in the database. Problem is: Trying to run the auction example. When trying to run "view all auction items" query the following SQL is constructed and MySQL rejects this as it contains a Turkish character () For those who cannot see this character correctly, it is ...

49. Predefined sql for security - user, role, groups, etc.?    forum.hibernate.org

OK, I understand that. But I'll use Hibernate and I just need sql for tables creation or classes and I'll make sql with Hibernate. Do you know where I can find it? Or can someone write it here (sql or java)? I guess it's just few tables, maybe 3-5! Thanks. P.S. I'm in advantage because I can write DB from start ...

50. Retun of status code on sql calls.    forum.hibernate.org

This is how we currently do... //SPM_SAMPLE is the stored procedure name. String query = "{ ?=Call SPM_SAMPLE(?) }"; //conn is the Connection object. CallableStatement stmt = conn.prepareCall(query); stmt.registerOutParameter(1, java.sql.Types.INTEGER); stmt.setString(2, sampleInputData); ResultSet rset = stmt.executeQuery(); int status = rset.getInt(1); //Is there is any error, status will be set to -1 and status set to 0 when there is no error. ...

51. Are UNIONS supported in SQL    forum.hibernate.org

Thanks for the reply. I don't see why it doesn't make sense, however. I now am working on implementing one by hand. I want a sales record for every location for a certain day. If there is no sales record for a store on that day, I want to create a blank object with only the location filled in.

52. Sql Result Sets    forum.hibernate.org

I am able to use the session.createSqlQuery to send native sql. However what I really want to do is create a query and get back a result set (not a list of objects) For example I would like to send the query : select sysdate from dual to an Oracle server. I can do this in Toplink with no problem since ...

53. Hibernate SQL as schemaName.tableName failing without owner    forum.hibernate.org

Hi Guys This is a formulisation of an earlier post on failing insert but more specific... Basically I have found that Hibernate is sending SQL calls (inserts for example) as schemaName.tableName. I tried this in SQL Server and it is invalid. SQL Server expects schemaName.owner.tableName where owner is pretty much always "dbo". We've not had this problem before using ouir JDBC ...

54. Uppercase SQL keywords - suggestion    forum.hibernate.org

Hi When I'm debugging my code, I usually have the show SQL switch on so I can see the SQL that Hibernate is generating. It would be really nice if the SQL keywords (e.g. SELECT, FROM, WHERE, JOIN, etc.) were in uppercase as it would be so much easier to read the SQL. Would this be difficult to do? It would ...

55. Cat example with SHOW_SQL flag = true    forum.hibernate.org

I've built the Cat example and am using a simple HQL query named "select.all.cats.order.by.weight" which I've stored in the mapping file. Everything works fine but when I turn on the SHOW-SQL flag in the hibernate.cfg.xml file and run my servlet, it appears that hibernate is executing a query for each row in the database. I expected a more efficient query such ...

56. trouble seeing output of show_sql    forum.hibernate.org

57. Custom SQL for CUD ignored    forum.hibernate.org

Author Message ernst_pluess Post subject: Custom SQL for CUD ignored Posted: Wed Sep 22, 2004 4:12 pm Expert Joined: Thu Jan 29, 2004 2:31 am Posts: 362 Location: Switzerland, Bern Hi I've a simple parent child layout where class A has many B's, which works fine. No I want to write my own CUD SQLs for B, but from ...

58. bad SQL grammar! why?!    forum.hibernate.org

Hibernate version: version 2 Mapping documents: hilo next ...

59. SQL keyword    forum.hibernate.org

Can I use the SQL keywork 'Left' in HQL I want to run query select distinct left(destCol,3) from TABLENAME where colName = 'IL'; When I use this in HQL like this >> select distinct left(a.destCol, 3) from TABLENAME as a where a.colName = 'IL' Hibernate is throwing error as ... 09:38:41,546 ERROR [STDERR] net.sf.hibernate.QueryException: undefined alias: left Thanks. --Anand

60. one-to-one SQL tuning    forum.hibernate.org

2.1.1: Hello, I am trying to tune the SQL that Hibernate runs when I'm loading a persistent instance. This instance (MiningResult below) has four one-to-one relationships to other classes using foreign keys. My goal is to have Hibernate execute one SQL select statement to pull in the fields from the main class (MiningResult) and the four one-to-one related classes together. I ...

61. patch to pretty print show_sql    forum.hibernate.org

Hibernate version:2.1.6 I have a minor patch to BatcherImpl that will pretty up the sql displayed on the console running hibernate with show_sql. Should I submit it thru the JIRA? Does anyone even want it? Index: BatcherImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/BatcherImpl.java,v retrieving revision 1.16 diff -u -r1.16 BatcherImpl.java --- BatcherImpl.java 7 Aug 2004 14:05:39 -0000 1.16 +++ BatcherImpl.java 19 Oct 2004 ...

62. Show complete SQL    forum.hibernate.org

63. SQL Extensions    forum.hibernate.org

I want to know how SQL Extensions can be used with Hibernate. I need to use "year" and "month" functions. My HQL is like this: select {fn YEAR(e.date)}, {fn MONTH(e.date)} from MyObject as e where not e.date is null I've seen in previous forum messages that this should be correct, but it doesn't work: net.sf.hibernate.QueryException: undefined alias: {fn Should I use ...

64. Slow dynamic sql without Hibernate    forum.hibernate.org

Scenario: I am considering Hibernate to solve data access problems. As an example, the code below is in the constructor of the ArAccountCollection class. the first query "stmt" takes ~40 minutes to return a resultset of 5500 records in production. Question: How can I utilize Hibernate to make this a more efficient DAO class? Hibernate version: na Mapping documents: na Code ...

65. How to control SQL creation.    forum.hibernate.org

There are lots of DBs and only one db is changed by operator. The Data in the main DB changed by the operation must be synchronized to other DBs. the changes to the DB is through hibernate2 session. and i want to copy the changes to other DBs like this way. 1. begin to notify hibernate to record SQL 2. operator ...

66. How to print SQL    forum.hibernate.org

67. Hibernate and IronGrid - IronEye SQL configuration URGENT!!!    forum.hibernate.org

dondragon2 Post subject: Posted: Tue Jan 11, 2005 3:07 pm Newbie Joined: Tue Jan 11, 2005 12:58 pm Posts: 15 It is not working: this is the output from the stack trace. [1/11/05 12:14:36:875 GMT-05:00] 3f4d0715 NamingHelper I net.sf.hibernate.util.NamingHelper JNDI InitialContext properties:{} [1/11/05 12:14:37:109 GMT-05:00] 3f4d0715 J2CXAResource E J2CA0036E: An exception occurred while invoking method setDataSourceProperties on com.ibm.ws.rsadapter.spi.WSManagedConnectionFactoryImpl used ...

68. show_sql not working    forum.hibernate.org

Hi everyone, i'm trying to debug a couple of statements and I've enabled SQL statement logging (I think) on hibernate.cfg.xml and tweaked the log4j.properties file to debug, but I can't seem to get any SQL output. The content of the files are: hibernate.cfg.xml Code:

69. How to get SQL stat while net.sf.hibernate.JDBCException?    forum.hibernate.org

Full stack trace of any exception that occurs: 2005-02-16 17:18:02,734 WARN [main] util.JDBCExceptionReporter (JDBCExceptionReporter.java:38) - SQL Error: 936, SQLState: 42000 2005-02-16 17:18:02,734 ERROR [main] util.JDBCExceptionReporter (JDBCExceptionReporter.java:46) - ORA-00936: missing expression 2005-02-16 17:18:02,734 WARN [main] util.JDBCExceptionReporter (JDBCExceptionReporter.java:38) - SQL Error: 936, SQLState: 42000 2005-02-16 17:18:02,734 ERROR [main] util.JDBCExceptionReporter (JDBCExceptionReporter.java:46) - ORA-00936: missing expression 2005-02-16 17:18:02,750 ERROR [main] util.JDBCExceptionReporter (JDBCException.java:38) - Could not ...

70. re-building an sql from an abstract format    forum.hibernate.org

Hi ppl: i have a mysql server fronted by a java application. I intend to have remote java clients who can directly communicate with the java app to indirectly interract with the mysql server, say they should be able to execute queries/updates using the java app's APIs. however, it would be good if the clients can get away with just sending ...

71. SQL "AND" "OR"    forum.hibernate.org

72. When show_sql is not enough    forum.hibernate.org

If you are using Hibernate 2.x then the package name should start net.sf.hibernate instead of org.hibernate (which is the 3.x pkg structure).. You may also have to change the word 'logger' in the lines depending on how your log4j config is setup... If you still cannot get it working - can you post your log4j config? and Hibernate version?

73. Custom sql w/ named params?    forum.hibernate.org

According to the H3 docs, looks like custom sql (i.e. , , etc.) does not support named parameters? Is this something that is on the roadmap, or is it implemented and just not yet documented? I have a case where I need to only override the ... we are using an effective date record pattern and I want to essentially expire ...

74. Customizing org.hibernate.SQL output    forum.hibernate.org

Given a web based application where every user logs in with a different username, I would like to log whenever a user inserts, deletes, or updates data. I would like to be able to tell what user did what when to modify the data. Does Hibernate offer any way to modify the org.hibernate.SQL output and add information like a username to ...

75. Static SQL    forum.hibernate.org

76. Dynamic SQL    forum.hibernate.org

77. show_sql output format modification?    forum.hibernate.org

78. force Hibernate 3 to emit static SQL?    forum.hibernate.org

79. Old Style SQL Vs. ANSI SQL...    forum.hibernate.org

I am Using Hibernate 3.x and Oracle 9.x. I have this issue when I convert from native sql to ansi sql, some rows are not returned due to outer join differences. My original query in native SQL contains something like this... tableAlias.ColumnName (+) = 1 This above table participates in outer join with other tables, when I convert this query to ...

80. Bad SQL grammer    forum.hibernate.org

I'm using JDBC with spring and hibernate to connect to a Progress 9.1E database, when I execute a query i get the following error, stack trace: 10:21:39,984 INFO [SpringhibController] returning SpringhibController view 10:21:40,140 INFO [STDOUT] Hibernate: select country0_.CTLNAM as col_0_0_ from XMCTRY0 country0_ where country0_.CTISO=AE 10:21:40,140 WARN [JDBCExceptionReporter] SQL Error: -20005, SQLState: 42S02 10:21:40,140 ERROR [JDBCExceptionReporter] [JDBC Progress Driver]:Table/View/Syn onym not ...

81. SQL *PLUS Commands    forum.hibernate.org

82. Looking for workaround to gut-response of "use SQL Unio    forum.hibernate.org

Newbie Joined: Wed Sep 28, 2005 2:55 pm Posts: 1 Hopefully, I'm not wasting anybody's time, but I tried to do my homework first. I'm new to Hibernate, but have: looked through Hibernate in Action looked through Hibernate Quickly googled searched through these Forums My problem is that I need to get a result set for which my gut-response says to ...

83. Hibernate and SQL Requests    forum.hibernate.org

1 - If you want to learn: read the docs ;) If you just want to think you know then: of course if data is changed in the database then hibernates data will be out of date - that is also the case for any other jdbc access - and sometimes that is even what you want. But please go read ...

84. Vanishing comma in sql    forum.hibernate.org

Hibernate version: 3.05 I have the following sql string: Code: INFO - [NDDMetricService.getMetricBrowseFields] query: SELECT distinct new com.sbc.netrics.struts.database.NddMetric( NddMetric.metricId, NddMetric.metricNumber,NddMetric.metricName,NddMetric.metricDescription,NddMetric.dataSteward) FROM com.sbc.netrics.struts.database.NddMetric NddMetric WHERE large_xml <> 'Y' AND extract(xml_doc , '/metric_extended_attributes/*') like '%BUILD%' order by metric_name ASC Which yields the following debug: Code: Hibernate: select * from ( select distinct nddmetric0_.METRIC_ID as col_0_0_, nddmetric0_.METRIC_NUMBER as ...

85. Restrictions.ilike does not escape SQL specials - how can I?    forum.hibernate.org

CoreEJBLib.escapeSQLSpecials(strReturn) { // now replace all "'" with "''" strReturn = strInput.replaceAll("'", "''"); // now replace all "*" with "%" (note it is double escaped cos its a RegExp) strReturn = strReturn.replaceAll("\\*", "%"); // now replace all "?" with "_" (note it is double escaped cos its a RegExp) ...

87. How to (1) Make Hybernate run fast (2) debug hibernate SQL    forum.hibernate.org

I have couple of questions about Hibernate. (1) How to make Hibernate run fast? The application (Java accessing Oracle database through Hibernate) is taking long time with hibernate to come up. When i turn off the debug output from Hibernate (false), it didn't help that much. And i think, as the data in database grows, the hibernate application is going ...

88. the no raw sql police    forum.hibernate.org

So I'm being using Hibernate in my last few projects with Stored Procedures for every call. I have to create: { call myproc(?,?,?) } and it's fine, but I'm only using about 10% of hibernate. I want the other 90%. I work at a no-raw-sql police state company so ...

89. Need to solve the operator Sql IN    forum.hibernate.org

Hi, i'm new in Hibernate. I have to execute two sentences in a transaction with Hibernate, but i dont know how can i do it. The sentence in Sql is: 1.- delete from historico_accion where idsesion in (select idsesion from Historico_Sesion where f_ultimo_click <= TO_DATE('29/10/2005 23:59:59', 'DD/MM/YYYY HH24:MI:SS')) 2.- delete from Historico_Sesion where f_ultimo_click <= TO_DATE('29/10/2005 23:59:59', 'DD/MM/YYYY I dont know ...

90. SQL is not always working    forum.hibernate.org

Need help with Hibernate? Read this first: http://www.hibernate.org/ForumMailingli ... AskForHelp Hibernate version: 3.1 rc3 Name and version of the database you are using: MySQL 4 The generated SQL (show_sql=true): 11:49:41,663 DEBUG org.hibernate.SQL: select p.`DIRECTORYID` as DIRECTOR1_0_, p.`NAME` as NAME2_0_, p.`ACTIVE` as ACTIVE3_23_0_, p.`CONCEPTION` as CONCEPTION4_23_0_, p.`LASTMODIFIED` as LASTMODI5_23_0_ from `REMOTEPRINCIPAL` p ,`REMOTEPRINCIPALATTRIBUTES` pa, `REMOTEATTRIBUTEVALUES` a, `ATTRIBUTEVALUES` av where p.`DIRECTORYID` = ? ...

91. SQL obfuscation    forum.hibernate.org

I'm a SQL Server DBA, and I've inherited a database environment where heavy Hibernate (v 2.5) usage is taking place. As you may know, Hibernate significantly scrambles all SQL activity within the database, so when I profile one of our DBs, instead of SQL statements I see activity like: create proc #jtds000008 @P0 int AS INSERT... exec #jtds000008 ...

92. Turning "show_sql" on and off programmatically    forum.hibernate.org

93. Common SQL issue.... apostrophe ( ' )    forum.hibernate.org

Hi GUys I am facing a problem in my SQL query..when I use apostrophe (') Explaination: I want to search Java's in the search crieteria so my SQL looks like I used java's in my search textbox and following broblem is created in the QUERY: sql= select distinct project from Project as project where project.projectStatus.projectStage = 1 and ( project.deleted is ...

94. show real sql    forum.hibernate.org

Hi there, I just wanted to know if there is a way to print out the exact query in hibernate3. If I showsql=true then I get a query that looks like this: select * from dog where name = ? I want to be able to see what it uses instead of the '?'. Im using mysql.

95. Executes SQL asynchrously??    forum.hibernate.org

96. Incorrect Parentheses in SQL Translation    forum.hibernate.org

I tried to execute a SELECT HQL with several logic expressions with using parentheses and it's translated into a SQL. However, the returned result is unexpected and found that there has issue on the translated SQL and which those parentheses are located incorrectly!!! Prepared HQL Code: FROM Campaign AS c LEFT JOIN FETCH c.campInfo WHERE c.deleted = :deleted AND ( ( ...

97. arbitrary SQL WHERE condition    forum.hibernate.org

...

98. SQL Injections    forum.hibernate.org

99. custom sql create doesn't work for me    forum.hibernate.org

Hibernate version: 3.0.5 Mapping documents: IndexNavigare.hbm.xml Code:

100. personalization sql commands. It's possible?    forum.hibernate.org

Hi all, I would like to know if would be possible to personalize generated sql commands. For example, at specific moments the sql comands they are not appropriate for my intention. In this in case that I would like to modify then. If possible, it can be made of declarative form or programatic form? Or both ? I am thankful anticipatedly. ...