File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Problem in HQL from Oracle VIEW" Watch "Problem in HQL from Oracle VIEW" New topic

Problem in HQL from Oracle VIEW

Aby Arackal peter

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

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


create or replace force view "ROOT"."EMPLOYEE_VIEW" ("seq_id","first_name","last_name",) as
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


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.


Bill Gorder

Joined: Mar 07, 2010
Posts: 1632

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

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

Joined: Mar 07, 2010
Posts: 1632

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.
Don't get me started about those stupid light bulbs.
subject: Problem in HQL from Oracle VIEW
Similar Threads
one-to-one mapping.
problem with @FieldResult, mapping does not seem to work
Facing the problem while reterving the resultsets in java from named query function in hibernate
HIbernate Criteria when fired on VIEW returs list with NULL values