1. calling DB functions from Hibernate coderanch.comIf I have a SQL statement like SELECT TRUNC(sale_date,'DAY') AS WEEK FROM SALES how can I translate that to a hibernate query? I would expect to have to write my own method in my Sales.java bean to replace "trunc" but I can't seem to call a method of an object in my hibernate query: SELECT sales.saleDate, sales.saleDate.getWeek() from Sales sales doesn't ... |
2. How to call a db function from hibernate coderanch.comYes, you can used what is called a Named QUery, where in an xml file you create the call to the stored procedure, you will include ? to allow you to pass in the parameters. Here is one big caveat. There can only be one out parameter and it must be the first parameter. Mark |
3. Help registering custom Scalar Function on custom dialect forum.hibernate.orgpublic class POSSQLServerDialect extends SQLServerDialect { public POSSQLServerDialect() { super(); registerFunction("fpadsetoresdesc", getFpadSetoresDesc()); } private SQLFunction getFpadSetoresDesc() { return new SQLFunctionTemplate(Hibernate.OBJECT, AppConfig.getDatabaseSchema() + ".fpadsetoresdesc(?1)"); } } |
4. [ODBC MS Access Driver]optional function not implement forum.hibernate.orgNewbie Joined: Mon Feb 18, 2008 10:44 am Posts: 9 I use MS Access Database2007,my database is follows: Code: id Text (key) userid Text passwd Text xml file is follows: Code: |
10. Help Required in using nested database functions forum.hibernate.org |
11. Migrating 3.0 -> 3.1 postgres function problem forum.hibernate.orgHi, I'm having a problem migrating a hibernate 3.0 app to 3.1 for a few queries. I'll post others later, but the first one I'm tackling concerns using postgres functions using hibernate. I'm not going to be posting map files, since there aren't really all that important, but the bolded lines in this query cause the following problems to happen below. ... |
12. any way to call database built in function in hibernate forum.hibernate.orgSuppose I have a query: SELECT * FROM exchange_pp WHERE TIMESTAMPDIFF(hour, last_updt_dt,now()) <96, which will get data for the past 96 hours. TIMESTAMPDIFF is mysql built in functoin. I have POJO for this table with field last_updt_dt. How could I create Hiberante query to get the same data as I used above query. |
13. DB2 iSeries - The driver does not support this function. forum.hibernate.orgHi, I hope someone can help me. I am new to Hibernate and I am trying to set up the example program eg (the Auction example). When test data is being inserted I get the following exception (The driver does not support this function). I am using the jt400.jar for DB2 on iSeries. Does anyone know what this means, what the ... |
14. Custom functions in a dialect forum.hibernate.org |
15. how can specialy database function use for global database? forum.hibernate.orgi want to count how many specialy string in the field. oracle used to next sentence. 'instr(field, findString, offset, count)' hibernate can resolve to use native sql by session.createSQLQuery or Restrictions.sqlRestrictions(). but this method was jsatified with oracle database, just. I want to use this function at global database. how can resolve this problem? thank you. |
16. calling postgresql function ...getting GenericJDBCException forum.hibernate.orgI m using postgresql db , I m facing with following problem 19:21:59,625 INFO [STDOUT] [2008-03-20 19:21:59,624] org.hibernate.util.JDBCExceptionReporter WARN org.apache.commons.logging.impl.Log4JLogger.warn(Log4JLogger.java:104) - SQL Error: 0, SQLState: null 19:21:59,626 INFO [STDOUT] [2008-03-20 19:21:59,625] org.hibernate.util.JDBCExceptionReporter ERROR org.apache.commons.logging.impl.Log4JLogger.error(Log4JLogger.java:114) - Batch entry 0 select * from createUser ('Testaa',2) as result was aborted. Call getNextException to see the cause. 19:21:59,626 INFO [STDOUT] [2008-03-20 19:21:59,626] org.hibernate.util.JDBCExceptionReporter WARN org.apache.commons.logging.impl.Log4JLogger.warn(Log4JLogger.java:104) ... |
17. Problem with day() function using Postgres forum.hibernate.org |