|
From: <leg...@at...> - 2003-08-09 12:14:14
|
Message:
The following issue has been closed.
Resolver: Gavin King
Date: Sat, 9 Aug 2003 7:13 AM
I think the new createSQLQuery() functionality is a better solution to this problem.
---------------------------------------------------------------------
View the issue:
http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-32
Here is an overview of the issue:
---------------------------------------------------------------------
Key: HB-32
Summary: Embeded Native SQL in HQL
Type: Improvement
Status: Closed
Priority: Major
Resolution: REJECTED
Project: Hibernate2
Fix Fors:
2.1 beta 1
Assignee: Gavin King
Reporter: Max Rydahl Andersen
Created: Sat, 3 May 2003 10:19 AM
Updated: Sat, 9 Aug 2003 7:13 AM
Description:
Embeded Native SQL in HQL
It will be nice to be able to embed native SQL in HQL.
By example we use Oracle connect by/starts with
clauses in SQL for retrive flat items from tree and some
predefined views. But it is not possible to use them in
HQL. Can you simple left all between <sql> and </sql>
unchanged?
Translate something like:
from x in XClass
where x.name like ?
and x.id in <sql>(
select id from XTable
connect by prior id = parent_id
starts with id = ?
)</sql>
TO:
SELECT ... FROM XTable as X WHERE X.name like ?
and (
select id from XTable
connect by prior id = parent_id
starts with id = ?
)
It mustn't be difficult, isn't it?
OR even more :
<sql>select a, b, c FROM T</sql>
TO:
select a, b, c, FROM T
OR even more :
select a.ad, <sql>getBestPrice(${a.id}, ${a.owner.id})
</sql> from a in class AAA;
TRANSLATES TO:
select a.id as f1, getBestPrice(a.id, e.id) as f2
from Article a, Enterprise e
where a.owner_id = e.id;
where getPestPrice is a SQL server function.
With best regards!
Dmitry M.Ivlev
http://sourceforge.net/tracker/index.php?func=detail&aid=711287&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
|