From: <leg...@at...> - 2003-12-28 04:59:39
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-585 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-585 Summary: Queries with Session.createSQLQuery() require hard-coded table names Type: Improvement Status: Unassigned Priority: Minor Project: Hibernate2 Components: core Versions: 2.1.1 Assignee: Reporter: Will Gayther Created: Sat, 27 Dec 2003 10:51 PM Updated: Sat, 27 Dec 2003 10:51 PM Description: The new sql queries run by calling Session.createSQLQuery() allow you to write an sql statement that refers to the properties of your objects, rather than having to remember or look up column names. Oddly though, they do require you to remember and hard-code the name of the table that stores the object(s) you're interested in, rather than letting you refer directly to the object you're interested in querying. For example: "SELECT {cat.*} FROM CAT AS {cat} WHERE ROWNUM<10" Notice that the table name "CAT" is hard-coded into the query. It would be much easier and abstract if I could refer to the name of the class rather than the name of the table. For example, like this: "SELECT {cat.*} FROM {cat} AS {cat} WHERE ROWNUM<10" Or, if that would add to much complication to the parser, than like this: "SELECT {cat.*} FROM {table:cat} AS {cat} WHERE ROWNUM<10" I've also discussed this issue somewhat on the forum: http://forum.hibernate.org/viewtopic.php?p=2183641#2183641 What do you think? --------------------------------------------------------------------- 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 |