From: <leg...@at...> - 2003-08-07 18:50:14
|
The following comment has been added to this issue: Author: Max Rydahl Andersen Created: Thu, 7 Aug 2003 1:49 PM Body: "impedeance mismatch" in the SQL ;) I got a question for ya' ;) If I want to load all A.class's with my SQLQuery i also have to get ALL the columns for my potential subclasses properties (Hibernate expects that) Currently this actually works: session.createSQLQuery("select id as {a.id}, clazz as {a.class}, count_ as {a.count}, name as {a.name} from A", "a", A.class); But note that {a.count} is actually referring to B.class property count, is this not misleading ? Is it ok to refer to subclasses properties as what is happening in this case ? Should we instead support class based property references ? so, the above would be: session.createSQLQuery("select id as {A.id}, clazz as {A.class}, count_ as {B.count}, name as {A.name} from A", "myA", A.class); Notice that A and B is now references to the mapped classes A and B. Here i don't even need the "myA" alias name.... ...or should we instead just keep the "old" syntax and then look at the alias name as an alias for the returnClass + their subclasses ? (this is what happens now ;) --------------------------------------------------------------------- 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 |