aspose file tools*
The moose likes Object Relational Mapping and the fly likes is it hql allow insert query Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "is it hql allow insert query" Watch "is it hql allow insert query" New topic
Author

is it hql allow insert query

Shinu Pil
Greenhorn

Joined: Sep 02, 2005
Posts: 9
Hi
i would like to insert into table using HQL query.I searched lot of net...but allinsert query are reference to another tavles
i would like to kno wwhat is hql query for

your help really appreciated
Hebert Coelho
Ranch Hand

Joined: Jul 14, 2010
Posts: 754

SHINU SHINU.R wrote:Hi
i would like to insert into table using HQL query.I searched lot of net...but allinsert query are reference to another tavles
i would like to kno wwhat is hql query for

your help really appreciated
I do not think this is possible.
You should use NativeQuery instead. This post shows how to use NativeQueries: http://uaihebert.com/?p=1274


[uaiHebert.com] [Full WebApplication JSF EJB JPA JAAS with source code to download] One Table Per SubClass [Web/JSF]
Alberto Ivo
Ranch Hand

Joined: Jul 06, 2007
Posts: 39
Shinu,

Look this tutorial: http://www.mkyong.com/hibernate/hibernate-query-examples-hql/

This sentence you are trying to do is native sql. Hibernate has his own sentence but very similar.

But why don't you use the insert method? Just populate your object and it's done.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: is it hql allow insert query