wood burning stoves 2.0*
The moose likes Object Relational Mapping and the fly likes Problem in HQL from Oracle VIEW Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Problem in HQL from Oracle VIEW" Watch "Problem in HQL from Oracle VIEW" New topic
Author

Problem in HQL from Oracle VIEW

Aby Arackal peter
Greenhorn

Joined: Apr 26, 2011
Posts: 7
Hi All,

Anybody please tell me How to create a HQL from Oracle View?

EMPLOYEE_VIEW

create or replace force view "ROOT"."EMPLOYEE_VIEW" ("seq_id","first_name","last_name",) as
select
employee.seq_id as "seq_id",
employee.first_name as "first_name",
employee.last_name as "last_name"
from employee employee
left join lookup_data lookup
on lookup.cat_id = employee.designation


EmployeeView.xml





EmployeeViewDto.java




I would like to map Above class to EMPLOYEE_VIEW , can I write the HQL?

I have done in following way but it is not working




Here Exception is coming...

Please tell me any solution.

Thanks,

Aby
Bill Gorder
Bartender

Joined: Mar 07, 2010
Posts: 1649
    
    7

Moving this to the ORM forum as it is not Spring related.


[How To Ask Questions][Read before you PM me]
Bill Gorder
Bartender

Joined: Mar 07, 2010
Posts: 1649
    
    7

Please post any exception you are receiving. Are you trying to replace the view with a query against the tables that make up the view or are you trying to use the view in your query? If it is the latter a view would be treated the same as a Table.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem in HQL from Oracle VIEW