Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8638369
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T10:42:42+00:00 2026-06-12T10:42:42+00:00

I was reading the Hibernate HQL tutorial and found that HQL doesn’t support INSERT

  • 0

I was reading the Hibernate HQL tutorial and found that HQL doesn’t support INSERT INTO..VALUES.. but INSERT INTO..SELECT.. i.e. HQL only support insert from another table.

Suppose I want to insert same values in one table and that data is not from any other table i.e. the values are not in any other table.Then how can I do that in HQL?

Also, would like to know the rational behind such restrictions in HQL?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T10:42:44+00:00Added an answer on June 12, 2026 at 10:42 am

    You don’t need to use hql to insert if the data is from another table.

    Simply get a reference to your entity, get a hold of a Hibernate session, and call save().

    According to http://docs.jboss.org/hibernate/orm/4.0/devguide/en-US/html/ch04.html#d0e2116

    Pseudo-syntax for INSERT statements

    INSERT INTO EntityName properties_list select_statement

    Only the INSERT INTO … SELECT … form is supported. You cannot specify explicit values to insert.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having some problems with hibernate and MySQL. I've been reading but I
I have been reading for a while regarding Hibernate but I can't seem to
Reading that how to do hibernate mapping for table or view without a primary
I tried reading Hibernate documentation. Hibernate One-To-One Fetch is optional - defaults to select,
I know that adding hbm2ddl.auto=create Hibernate will create the tables automatically reading the mapping
I have multiple machines running a service that is updating and reading values from
I am working on a Java application that will use some Hibernate (annotated by
I just started reading about JPA and its implementation in Hibernate. To understand the
I have been reading about JPA and EJB3 and would like to confirm that
I'm new on object persistence with Hibernate. I'm reading a book to try to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.