【发布时间】:2021-04-04 06:47:44
【问题描述】:
我需要一些指导。 我有下一个database(对不起,我还不能上传图片) 在这个数据库中,有些列具有相同的名称(例如 idDireccion),但在服务器端,外键定义为 this。
我遇到的问题是因为 Springboot 正在检测具有相同名称的列,我不知道我在映射数据库时是否遗漏了一些东西。我知道这与列名有关,因为我更改了它们并且它“有效”,但我宁愿不修改数据库结构。
Here'sJava 代码
我想澄清一些事情。我不希望程序在数据库中创建或更改任何内容。我只是希望它能够插入和编辑数据。
对不起,如果我不够清楚,英语不是我的主要语言。
这是我遇到的错误。
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'iCita' defined in mx.com.interfaces.iCita defined in @EnableJpaRepositories declared on JpaRepositoriesRegistrar.EnableJpaRepositoriesConfiguration: Cannot resolve reference to bean 'jpaMappingContext' while setting bean property 'mappingContext'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jpaMappingContext': Invocation of init method failed; nested exception is org.hibernate.MappingException: Unable to find column with logical name: idEmpresa in org.hibernate.mapping.Table(Empresa) and its related supertables and secondary tables
【问题讨论】:
-
能否添加“Empresa”类来检查是否有问题?