Eclipse报告我的JPA项目的错误 [英] Eclipse reports error on my JPA project

查看:423
本文介绍了Eclipse报告我的JPA项目的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每次我做一个JPA项目,Eclipse报告说我的项目有错误,但我不明白为什么这样做。我在下面添加了图像和错误:

Each time I make a JPA project Eclipse reports that there are errors in my project but I do not understand why it does so. I added image and errors below:


描述资源路径位置类型列id无法在表页上解析
Page.java / BreakpointJPA / src / no /断点/域行
14 JPA问题

Description Resource Path Location Type Column "id" cannot be resolved on table "page" Page.java /BreakpointJPA/src/no/breakpoint/domain line 14 JPA Problem

描述资源路径位置类型列title不能
在表
pagePage.java / BreakpointJPA / src / no /断点/域行18 JPA
问题

Description Resource Path Location Type Column "title" cannot be resolved on table "page" Page.java /BreakpointJPA/src/no/breakpoint/domain line 18 JPA Problem

描述资源路径位置类型主键加入列id
无法解析表
pagePage.java / BreakpointJPA / src / no /断点/域行10 JPA
问题

Description Resource Path Location Type Primary key join column "id" cannot be resolved on table "page" Page.java /BreakpointJPA/src/no/breakpoint/domain line 10 JPA Problem

推荐答案

我已经有了ame问题,我的解决办法是刷新数据库连接。

I've had the same problem, the solution for me was to refresh the database connection.

打开JPA视图,查找数据源资源管理器。在那里你打开数据库连接,连接你的数据库,点击刷新。然后在您的文件中进行一些更改并保存,我在我的id字段中添加了一个@Column(name =)注释。之后,错误消息消失了,我提高了Column注释。

Open the JPA view, find the data source explorer. There you open Database Connection, connect with your database, hit refresh. Then make some changes in your file and save it, i added an @Column(name = "") annotation to my id field. After that the error message was gone, and i ereased the Column annotation.

问题似乎是eclipse在建立第一个连接后读取数据库表,之后连接关闭。所以如果你像我这样做,在你的数据库中这个第一个连接之后做了一些改变,比如将字段名称从foo_id改为只是id,eclipse不知道这个错误,并附带这个错误。

The Problem seems to be that eclipse reads the database tables after establishing the first connection, after that the connection is closed. So if you, like i did, made some changes after this first connection in your database, like changing the field name from foo_id to just id, eclipse didn't know that and comes with this error.

这篇关于Eclipse报告我的JPA项目的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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