• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Henry Wong
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Joe Ess
  • salvin francis

How to Insert values through HQL Insert :-(

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI Everybody,
Can any one of you help me,How to insert values in HQL Insert
Here i am providing sample code...and i am hard coding the values and insert the values in the table.Can anyone please change my code
so tht i can insert the values through HQL Insert(Provide the HQL in my code)




Thanks & Regards,
Bhaskar

[Edited to use code tags - Paul Sturrock ]
[ June 19, 2007: Message edited by: Paul Sturrock ]
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why do you want to do this using HQL? What happens when you run the code you posted above?
 
Vijay Bhaskar
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My task is to insert the data through HibernateQueryLanguage thats why i requested for you people to help me.Can you please do that for me
 
Paul Sturrock
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK. Well the reason I ask why you want to do it in HQL, is because HQL only supports insert from another table, so:

would be how you do it.

Looking at your code above however there is no other table to select from.
 
ranger
Posts: 17344
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Vijay Bhaskar:
My task is to insert the data through HibernateQueryLanguage thats why i requested for you people to help me.Can you please do that for me



Please keep it nice. If read in the tone I think it is read it is being a bit bossy and not nice.

It also sounds to me if you have a task like this then it isn't a job related task, because the original code would be the way to do it, using the save() or persist() method. It sounds like a classroom or job interview task, which we don't give answers away for those.

Mark
 
The glass is neither half full or half empty. It is too big. But this tiny ad is just right:
Sauce Labs - World's Largest Continuous Testing Cloud for Websites and Mobile Apps
https://coderanch.com/t/722574/Sauce-Labs-World-Largest-Continuous
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!