bindingsecurity constraintt是什么意思

& 2015 Xamarin Inc.Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free.
i have this issue :
Cannot add or update a child row: a
foreign key constraint fails
(bytecodete.company_links,
CONSTRAINT FK_company_links_1
FOREIGN KEY (id) REFERENCES
company (idUser) ON DELETE CASCADE
ON UPDATE CASCADE)
But i don't really understand this happens, so i will post my tables here:
//USER TABLE
DROP TABLE IF EXISTS `bytecodete`.`user`;
CREATE TABLE
`bytecodete`.`user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`email` varchar(255) NOT NULL,
`password` varchar(255) NOT NULL,
`type` tinyint(1) unsigned NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `email` (`email`)
//COMPANY TABLE
DROP TABLE IF EXISTS `bytecodete`.`company`;
CREATE TABLE
`bytecodete`.`company` (
`idUser` int(11) NOT NULL,
`fantasyName` varchar(55) NOT NULL,
`corporateName` varchar(55) NOT NULL,
`cnpj` varchar(14) NOT NULL,
PRIMARY KEY (`idUser`),
UNIQUE KEY `cnpj` (`cnpj`),
CONSTRAINT `company_ibfk_1` FOREIGN KEY (`idUser`) REFERENCES `user` (`id`)
ON DELETE CASCADE ON UPDATE CASCADE
// COMPANY_LINKS TABLE
DROP TABLE IF EXISTS `bytecodete`.`company_links`;
CREATE TABLE
`bytecodete`.`company_links` (
`id` int(11) NOT NULL DEFAULT '0',
`idCompany` int(10) unsigned NOT NULL,
`serviceName` varchar(45) NOT NULL,
`link` varchar(45) NOT NULL,
PRIMARY KEY (`id`) USING BTREE,
CONSTRAINT `FK_company_links_1` FOREIGN KEY (`id`) REFERENCES `company` (`idUser`)
ON DELETE CASCADE ON UPDATE CASCADE
I know this exception gives when i try to insert something in an table where there's a foreign key and i don't have setup some value to this key.
But this isn't my case, here is my output:
11:47:30,809
INFO SessionFactoryObjectFactory:82 - Not binding factory to JNDI, no JNDI name configured
Hibernate:
bytecodete.user
(email, password, type)
11:47:30,948 TRACE StringType:133 - binding 'valter.' to parameter: 1
11:47:30,949 TRACE StringType:133 - binding 'U25YM/DOl5k=' to parameter: 2
11:47:30,950 TRACE IntegerType:133 - binding '2' to parameter: 3
Hibernate:
(cnpj, corporateName, fantasyName, idUser)
(?, ?, ?, ?)
11:47:31,214 TRACE StringType:133 - binding '00' to parameter: 1
11:47:31,215 TRACE StringType:133 - binding 'Semana da Computa??o e Tecnologia' to parameter: 2
11:47:31,215 TRACE StringType:133 - binding 'SECOT' to parameter: 3
11:47:31,216 TRACE IntegerType:133 - binding '37' to parameter: 4
idCompany=37
Hibernate:
company_.idUser,
company_.cnpj as cnpj9_,
company_.corporateName as corporat3_9_,
company_.fantasyName as fantasyN4_9_
pany company_
company_.idUser=?
11:47:31,300 TRACE IntegerType:133 - binding '37' to parameter: 1
11:47:31,316 TRACE StringType:172 - returning '00' as column: cnpj9_
11:47:31,316 TRACE StringType:172 - returning 'Semana da Computa??o e Tecnologia' as column: corporat3_9_
11:47:31,351 TRACE StringType:172 - returning 'SECOT' as column: fantasyN4_9_
Hibernate:
pany_links
(idCompany, link, serviceName, id)
(?, ?, ?, ?)
11:47:31,353 TRACE IntegerType:133 - binding '37' to parameter: 1
11:47:31,354 TRACE StringType:133 - binding '/services/api/' to parameter: 2
11:47:31,354 TRACE StringType:133 - binding 'Flickr' to parameter: 3
11:47:31,355 TRACE IntegerType:133 - binding '0' to parameter: 4
11:47:31,433
WARN JDBCExceptionReporter:77 - SQL Error: 1452, SQLState: 23000
11:47:31,452 ERROR JDBCExceptionReporter:78 - Cannot add or update a child row: a foreign key constraint fails (`bytecodete`.`company_links`, CONSTRAINT `FK_company_links_1` FOREIGN KEY (`id`) REFERENCES `company` (`idUser`) ON DELETE CASCADE ON UPDATE CASCADE)
Sorry guys bothering you, but i really need help with this, i don't know what's happen.
Best regards,
Valter Henrique.
4,5962880135
We'd probably need to see some code to help you more, but just based on the INSERT statements, it looks like maybe your foreign key from company_links to company is wrong.
Your INSERT into company_links has a 37 for idCompany, and a 0 for id.
Your foreign key is set up on id, not idCompany, so the 37 should be set on id, or the foreign should be changed to idCompany.
5,04512242
Looks like you have your parameter order mixed up.
Your insert statement is:
pany_links
(idCompany, link, serviceName, id)
(?, ?, ?, ?)
And you are binding 37 to parameter 1 (idCompany), and 0 to parameter 4 (id).
The id needs to be 37, not 0.
3,11811827
Your Answer
Sign up or
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Post as a guest
By posting your answer, you agree to the
Not the answer you're looking for?
Browse other questions tagged
Stack Overflow works best with JavaScript enabled约束英文怎么翻译!谢谢!!!_百度知道
约束英文怎么翻译!谢谢!!!
提问者采纳
约束[数] constraint;restrain;restraint更多释义&&[网络短语]
约束 Constraint,restraint,CHECK约束理论 TOC,Theory of Constraints,Binding Theory路径约束 Path Constraint,Path-follow constraint,path constraint
提问者评价
太给力了,你的回答完美的解决了我的问题!
来自团队:
其他类似问题
为您推荐:
英文的相关知识
其他2条回答
约束 :restrain ,bind ,tie ,restraint , bound例句:约束自 己 restrain one'约束自己 的感情短语1.约束爆炸
constraint
restrain也是约束的意思
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁capacity-constraint-is-binding
此结果来自百度翻译,长句或段落建议您使用
1. Spending could outrun the capacity of businesses to produce the goods.
消费有可能超出企业的产能。
来自柯林斯例句
2. Grease 6 ramekin dishes of 150 ml (5-6 fl oz) capacity.
将6个容量为150毫升(5至6液盎司)的烤盘涂上油。
来自柯林斯例句
3. Her mental capacity and temperament are as remarkable as his.
她的才智和气质和他一样出众。
来自柯林斯例句
4. Toronto hospital maternity wards were filled to capacity.
多伦多医院的产房都已住满了。
来自柯林斯例句
5. Bread factories are working at full capacity.
面包厂正在全力生产。
来自柯林斯例句
0){var rand = parseInt(Math.random() * (000)+100000);top.location.href='/'+encodeURIComponent(document.getElementById('s').value.trim().replace( / /g, '_'))+'?renovate='+}else{top.location.href='/'+encodeURIComponent(document.getElementById('s').value.trim().replace( / /g, '_'));};}" action="/">
查过的词自动加入生词本
Tip:此功能设置只能在登录状态下生效
capacity-constraint-is-binding
需要改进的内容:
单词大小写
其他(请在下面补充描述)
错误描述:
您还可在这里补充说明下 O(∩_∩)O~
方便的话,请您留下一种联系方式,便于问题的解决:}

我要回帖

更多关于 jsbinding是什么 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信