Subsonic 3 ActiveRecord生成问题
我是堆栈溢出的新用户,我的英语不太好,我希望你理解我的麻烦。
当我编译模板时,这个存档 .cs 没问题(上下文、结构),但在 ActiveRecord 中,代码不完整。
似乎系统在第 5017 行中断了编译,并且没有向我返回任何异常。
我的代码停在这里:
public static PagedList
; GetPaged(int pageIndex, int pageSize) { 返回 GetRepo().GetPaged(pageIndex, 页面大小);
<前><代码> } 公共字符串密钥名称() { 返回 ”
我想这可能是传输限制或我的表“VeiculoOpcional”的问题..我不知道。
无论如何,这是表格的结构:
CREATE TABLE `veiculoopcional` (
`ID_Veiculo` int(11) NOT NULL,
`ID_Opcional` int(4) NOT NULL,
PRIMARY KEY (`ID_Veiculo`,`ID_Opcional`),
KEY `FK_veiculoopcional_Opcional` (`ID_Opcional`),
CONSTRAINT `FK_veiculoopcional_Opcional` FOREIGN KEY (`ID_Opcional`) REFERENCES `opcional` (`ID_Opcional`) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT `FK_veiculoopcional_Veiculo` FOREIGN KEY (`ID_Veiculo`) REFERENCES `veiculo` (`ID_Veiculo`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
有人遇到过或遇到过同样的问题吗?我在网上没有找到任何参考,
非常感谢。
I´m newer user in stack overflow and my english i´snt so good i hope you understand my trouble.
when I´m compiling my template this archives .cs it´s ok (Context, Structs), but in the ActiveRecord the code comes incomplete.
It seems that the system Break de compilation at line 5017 and not return any exceptions to me.
my code stops here:
public static PagedList<Veiculoopcional>
GetPaged(int pageIndex, int pageSize)
{
return GetRepo().GetPaged(pageIndex,
pageSize);} public string KeyName() { return "
i guess this probably a limit of transmition or problem with my table "VeiculoOpcional".. i don´t know.
Any way this the strcture of the table:
CREATE TABLE `veiculoopcional` (
`ID_Veiculo` int(11) NOT NULL,
`ID_Opcional` int(4) NOT NULL,
PRIMARY KEY (`ID_Veiculo`,`ID_Opcional`),
KEY `FK_veiculoopcional_Opcional` (`ID_Opcional`),
CONSTRAINT `FK_veiculoopcional_Opcional` FOREIGN KEY (`ID_Opcional`) REFERENCES `opcional` (`ID_Opcional`) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT `FK_veiculoopcional_Veiculo` FOREIGN KEY (`ID_Veiculo`) REFERENCES `veiculo` (`ID_Veiculo`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
Anybody had or passed by this same problem ? i don´t found any refference in net
Many Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
SubSonic 不支持复合主键(即多列主键)。使 ('ID_Veiculo','ID_Opcional') 对唯一,添加新列,并将新列设为主键。
SubSonic does not support composite primary keys (i.e. multiple column primary keys). Make the pair ('ID_Veiculo','ID_Opcional') unique, add a new column, and make the new column your primary key.