使用Doctrine 2执行原始SQL [英] Execute raw SQL using Doctrine 2

查看:87
本文介绍了使用Doctrine 2执行原始SQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用Doctrine 2执行原始SQL

I want to execute raw SQL using Doctrine 2

我需要截断数据库表并初始化具有默认测试数据的表。

I need to truncate the database tables and initialize tables with default test data.

推荐答案

我发现答案可能是:


您执行本机
SQL,根据
映射结果。描述如何将
SQL结果集映射到Doctrine
结果的
规范由
ResultSetMapping表示。

A NativeQuery lets you execute native SQL, 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.

资料来源: Native SQL

这篇关于使用Doctrine 2执行原始SQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆