1
0
mirror of synced 2025-01-18 06:21:40 +03:00

Note that Native SQL Query is not to be used for DELETE, UPDATE and INSERT statements.

This commit is contained in:
Benjamin Eberlei 2010-12-30 22:13:57 +01:00
parent ef8689c400
commit 72081ff7ba

View File

@ -1,7 +1,7 @@
Native SQL
==========
A ``NativeQuery`` lets you execute native SQL, mapping the results
A ``NativeQuery`` lets you execute native SELECT SQL statements, mapping the results
according to your specifications. Such a specification that
describes how an SQL result set is mapped to a Doctrine result is
represented by a ``ResultSetMapping``. It describes how each column
@ -9,6 +9,14 @@ of the database result should be mapped by Doctrine in terms of the
object graph. This allows you to map arbitrary SQL code to objects,
such as highly vendor-optimized SQL or stored-procedures.
.. note::
If you want to execute DELETE, UPDATE or INSERT statements
the Native SQL API cannot be used and will probably throw errors.
Use ``EntityManager#getConnection()`` to access the native database
connection and call the ``executeUpdate()`` method for these
queries.
The NativeQuery class
---------------------