HQL statement cannot be used to insert data

Source: Internet
Author: User
Using the HQL statement to complete the insert operation is not possible, whether you use the Insert Into....values ... or insert Into.....select ..... No,

because Hibernate's HQL language is used for object-oriented query functionality, but there is no query action involved in the insert operation, so HQL cannot be used for INSERT statements, while Select, Update, Delete statements can have a possible query implementation, such as: The

SELECT statement when the standard query, this does not have to say the
UPDATE statement: Update object name Set.....where
... Delete statement: Delete from object name where ...
.. See, update and delete involve the query filtering process in where, which needs to be implemented with HQL, but insert is never involved in the query filtering process, so hibernate does not insert inserts

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.