mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
DDC-3543: How to map and use a DB View from Doctrine2 #4360
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @doctrinebot on GitHub (Jan 26, 2015).
Originally assigned to: @Ocramius on GitHub.
Jira issue originally created by user reynierpm:
I have a view on
nomencladoresschema calledobtenerPaisesPorFabricanteProductoSolicitud. This is the content for the view:I'm trying to map the view as follow:
But any time I run this code on it:
I got this result:
{quote}
An exception occurred while executing 'SELECT t0.psid AS psid1,
t0.fpsid AS fpsid2, t0.nombre AS nombre3 FROM
nomencladores.obtenerPaisesPorFabricanteProductoSolicitud t0 WHERE
t0.fpsid = ?' with params [22]:
SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "nomencladores.obtenerpaisesporfabricanteproductosolicitud" does not
exist LINE 1: ...d1, t0.fpsid AS fpsid2, t0.nombre AS nombre3 FROM
nomenclado...
{quote}
If I remove the annotations then the error transform on this:
{quote}
Class "AppBundle\Entity\ObtenerPaisesPorFabricanteProductoSolicitud" is not a valid entity or mapped super class."
{quote}
Why Doctrine2 or Symfony tries to execute the query instead go through the view? How I can execute the view from Symfony2/Doctrine2 side?
@doctrinebot commented on GitHub (Jan 26, 2015):
Comment created by @ocramius:
Nothing wrong here: the SQL generated by the ORM is correct, but your view definition is wrong: try running the select in console, manually.
@doctrinebot commented on GitHub (Jan 26, 2015):
Issue was closed with resolution "Invalid"