From: <leg...@at...> - 2003-06-02 12:30:01
|
The following comment has been added to this issue: Author: David Channon Created: Mon, 2 Jun 2003 7:29 AM Body: I accept the issue. I can see it has a high priority. See how we go - I cannot say that it will be done for v2.0 release. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-117 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-117 Summary: Support for more SQL functions in SELECT Type: Improvement Status: Assigned Priority: Major Project: Hibernate2 Components: core Assignee: David Channon Reporter: Gavin King Created: Sun, 1 Jun 2003 7:58 PM Updated: Sun, 1 Jun 2003 7:59 PM Description: Currently, Hibernate supports exactly five (hardcoded) SQL functions in the HQL SELECT clause. They are the aggregate functions COUNT(), AVG(), SUM(), MIN(), MAX() A number of users would like to be able to specify an arbitrary SQL function in the SELECT. The problem here is that we need to know the return type of the function to be able to read it from the result set. I propose that the Dialect classes include a collection of mappings from function names to Hibernate types (eg. CURRENT_DATE -> Hibernate.DATE). That way, we can support the most commonly used SQL functions, and others can be easily added by users providing extensions to the Dialect. So, we would like to allow: SELECT CURRENT_DATE(), TRUNC(foo.amount), ...... --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-08-03 14:06:14
|
The following comment has been added to this issue: Author: David Channon Created: Sun, 3 Aug 2003 9:05 AM Body: The initial cut for this change has been completed. What I have done: * Moved the hard coded aggregate functions into the base Dialect. * Added the facility of other Dialects to add Dialect specific functions. In my case I have change the Oracle9i Dialect by adding trunc, sysdate, and other functions * Modified the SelectParser to simplify parsing of aggregate functions. No longer have special cases for count or avg functions. * Added an interface and general class for suppling the return type of the function. * Added an extra test(s) to SQLFunctionTest Given I have added extra functions to the Oracle dialect you can now use extra select functions such as.. select sysdate, trunc(s.value) from s as class simple --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-117 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-117 Summary: Support for more SQL functions in SELECT Type: Improvement Status: In Progress Priority: Major Project: Hibernate2 Components: core Assignee: David Channon Reporter: Gavin King Created: Sun, 1 Jun 2003 7:58 PM Updated: Mon, 9 Jun 2003 6:44 AM Description: Currently, Hibernate supports exactly five (hardcoded) SQL functions in the HQL SELECT clause. They are the aggregate functions COUNT(), AVG(), SUM(), MIN(), MAX() A number of users would like to be able to specify an arbitrary SQL function in the SELECT. The problem here is that we need to know the return type of the function to be able to read it from the result set. I propose that the Dialect classes include a collection of mappings from function names to Hibernate types (eg. CURRENT_DATE -> Hibernate.DATE). That way, we can support the most commonly used SQL functions, and others can be easily added by users providing extensions to the Dialect. So, we would like to allow: SELECT CURRENT_DATE(), TRUNC(foo.amount), ...... --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-08-03 14:16:14
|
The following comment has been added to this issue: Author: Gavin King Created: Sun, 3 Aug 2003 9:15 AM Body: Ace! Fantastic :) Ummmm .... are you submitting a patch for this? --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-117 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-117 Summary: Support for more SQL functions in SELECT Type: Improvement Status: In Progress Priority: Major Project: Hibernate2 Components: core Assignee: David Channon Reporter: Gavin King Created: Sun, 1 Jun 2003 7:58 PM Updated: Mon, 9 Jun 2003 6:44 AM Description: Currently, Hibernate supports exactly five (hardcoded) SQL functions in the HQL SELECT clause. They are the aggregate functions COUNT(), AVG(), SUM(), MIN(), MAX() A number of users would like to be able to specify an arbitrary SQL function in the SELECT. The problem here is that we need to know the return type of the function to be able to read it from the result set. I propose that the Dialect classes include a collection of mappings from function names to Hibernate types (eg. CURRENT_DATE -> Hibernate.DATE). That way, we can support the most commonly used SQL functions, and others can be easily added by users providing extensions to the Dialect. So, we would like to allow: SELECT CURRENT_DATE(), TRUNC(foo.amount), ...... --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-08-04 08:56:14
|
The following comment has been added to this issue: Author: David Channon Created: Mon, 4 Aug 2003 3:55 AM Body: While doing further testing I decided to expand the scope of the functionality. All of the above plus below. NOTE: I have added Dialect functions only to Oracle thus these examples only apply to the Oracle Dialect (at the moment). Extra since last comment. * The parser can deal with no argument functions with and without parenthesis. This was required for Oracle as its current date function is sysdate with no parenthesis and other databases use empty pair of parenthesis. For example. select s.name, sysdate, trunc(s.pay), round(s.pay) from s in class Simple * Nesting of functions is now allowed. For example: select abs(round(s.pay)) from s in class Simple select trunc(round(sysdate)) from s in class Simple It is very easy to add functions to your Dialect of choice. I have attached a patch(s). --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-117 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-117 Summary: Support for more SQL functions in SELECT Type: Improvement Status: In Progress Priority: Major Project: Hibernate2 Components: core Assignee: David Channon Reporter: Gavin King Created: Sun, 1 Jun 2003 7:58 PM Updated: Mon, 9 Jun 2003 6:44 AM Description: Currently, Hibernate supports exactly five (hardcoded) SQL functions in the HQL SELECT clause. They are the aggregate functions COUNT(), AVG(), SUM(), MIN(), MAX() A number of users would like to be able to specify an arbitrary SQL function in the SELECT. The problem here is that we need to know the return type of the function to be able to read it from the result set. I propose that the Dialect classes include a collection of mappings from function names to Hibernate types (eg. CURRENT_DATE -> Hibernate.DATE). That way, we can support the most commonly used SQL functions, and others can be easily added by users providing extensions to the Dialect. So, we would like to allow: SELECT CURRENT_DATE(), TRUNC(foo.amount), ...... --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2004-07-27 20:20:31
|
The following comment has been added to this issue: Author: CVS Notification Service Created: Tue, 27 Jul 2004 3:43 PM Body: CVS COMMIT LOG: SUBJECT: [Hibernate-commits] Hibernate2/src/net/sf/hibernate/type ArrayType.java,1.14,1.15 ObjectType.java,1.16,1.17 fixed HB-117 problems with array and any types --------------------------------------------------------------------- View this comment: http://opensource.atlassian.com/projects/hibernate/browse/HB-117?page=comments#action_13853 --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/browse/HB-117 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-117 Summary: Support for more SQL functions in SELECT Type: Improvement Status: Closed Priority: Major Resolution: FIXED Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: Hibernate2 Components: core Fix Fors: 2.0.3 2.1 beta 1 Assignee: David Channon Reporter: Gavin King Created: Sun, 1 Jun 2003 7:58 PM Updated: Tue, 27 Jul 2004 3:43 PM Description: Currently, Hibernate supports exactly five (hardcoded) SQL functions in the HQL SELECT clause. They are the aggregate functions COUNT(), AVG(), SUM(), MIN(), MAX() A number of users would like to be able to specify an arbitrary SQL function in the SELECT. The problem here is that we need to know the return type of the function to be able to read it from the result set. I propose that the Dialect classes include a collection of mappings from function names to Hibernate types (eg. CURRENT_DATE -> Hibernate.DATE). That way, we can support the most commonly used SQL functions, and others can be easily added by users providing extensions to the Dialect. So, we would like to allow: SELECT CURRENT_DATE(), TRUNC(foo.amount), ...... --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |