From: <leg...@at...> - 2003-08-06 11:18:15
|
The following comment has been added to this issue: Author: Max Rydahl Andersen Created: Wed, 6 Aug 2003 6:17 AM Body: I've just attached patch that adds very simple sql support to Hibernate. It is just a "see what it can do" example that I hope you will look into and see if we can do better ;) In doing it i found out that it is actually quite hard to write the sql that is needed to fetch these objects - but i got the basics working. It works as follows: SQLQuery query = session.createSQLQuery("select s.id as {simple.id}, s.name as {simple.name} from {simple} s", "simple", Category.class); The code for SQLLoader et.al. is highly inspired on how Criteria works - it is actually copy-paste and then delete code as it somewhat simple than Criteria's ;) YES - i know. This is not how it is laid out in the roadplan - here it is only for named queries, but i did not want to use time on writing Binder code before i could actually execute the queries ;) One big problem i've found with the current solution: - How do we get the alias name for the discriminator value to be used when dealing with subclasses ? This name is only available internally - could not find a way to refer to it from a query or similar) --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-18 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-18 Summary: Integrate support for SQL queries Type: New Feature Status: In Progress Priority: Major Project: Hibernate2 Assignee: Max Rydahl Andersen Reporter: Max Rydahl Andersen Created: Sat, 3 May 2003 10:08 AM Updated: Wed, 6 Aug 2003 6:10 AM Description: Integrate support for SQL queries To execute SQL in Hibernate one aquires a connection as normal or via the session object. This can really only be used to fetch scalar values. A real nice feature would be to be able to provide SQL directly as an alternative to HQL. The SQL should ofcourse return the named columns and data types that Hibernate expects to be able to instantiate objects from the resultset. (original: http://sourceforge.net/tracker/index.php?func=detail&aid=622605&group_id=40712&atid=428711= --------------------------------------------------------------------- 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 |