Subsonic 3 和 Activerecord 不生成 MySQL 存储过程
似乎包含的 T4 模板(或 SVN 主干中的模板)只是跳过为 MySQL 生成 SP... 当 StoredProcedures.ttinclude 与 MySQL.ttinclude 一起运行时,我收到错误“编译转换:名称“GetSPs”在当前上下文中不存在”。
GetSPs 是为 SQLServer 定义的,我看到有人为 Oracle 编写了自己的方法,但是有人知道正确的 GetSPs() 方法对于 MySQL 应该是什么样子吗?
就我个人而言,我认为除非我可以运行自己的 SP,否则它没有真正的功能:/
It seems that the included T4 templates (or the one in the SVN trunk for that matter) just skips generating SPs for MySQL...
When running StoredProcedures.ttinclude together with MySQL.ttinclude, I get the error "Compiling transformation: The name 'GetSPs' does not exist in the current context".
GetSPs is defined for SQLServer and I saw that someone wrote his own for Oracle, but does anyone have a clue how the proper GetSPs()-method should look like for MySQL?
Personally I don't think it's really functional unless I can run my own SPs :/
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我对版本 2 中的代码进行了一些修改,并想出了一些对我有用的代码(可能不是在所有情况下 100%)。 将其放入 MySQL.ttinclude 中以生成存储过程。 享受!
I tinkered around a bit with the code from version 2 and came up with a little code (probably not 100% in all situations) that did the trick for me. Put this in MySQL.ttinclude to get Stored Procedures generated. Enjoy!
我通过将这段代码添加到我的 MySQL.ttinclude 来运行它,但是我必须将通用列表更改为类型化列表。 例如:
List
和List
。 不过,代码在那之后就可以工作了;-)I got this code to run by adding it to my MySQL.ttinclude however I had to change the generic List's to typed lists. eg:
List<SPParam>
andList<SP>
. The code worked after that though ;-)根据 craig 的回答,我将列表更改为类型化列表,并且还需要从
GetSPList()
代码块中删除var result=new List();
。 干杯As per craig's answer, I changed the Lists to typed lists and I also needed to remove
var result=new List();
from theGetSPList()
code block. Cheers