简体   繁体   English

Eclipse 中缺少 JPA 工具菜单

[英]JPA Tools Menu Missing From Eclipse

I have created a Spring Boot application (Maven project) with JPA and SQL Server dependencies.我创建了一个带有 JPA 和 SQL Server 依赖项的Spring Boot 应用程序(Maven 项目)。 When I open the project in Eclipse and right-click on my project in the Project Explorer, I do not seem the JPA Tools option.当我在 Eclipse 中打开项目并在项目资源管理器中右键单击我的项目时,我似乎没有JPA 工具选项。

The JPA section is also missing in the Project Facets. Project Facets 中也缺少 JPA 部分。

Eclipse Version : Oxygen.2 Release 4.7.2 Eclipse 版本:Oxygen.2 版本 4.7.2

Java Version : 1.8 Java 版本:1.8

OS : macOS High Sierra Version 10.13.4操作系统:macOS High Sierra 版本 10.13.4

在此处输入图片说明

you should add JPA facet to your project.您应该将 JPA facet 添加到您的项目中。

Project -> context menu -> property -> project facets -> JPA项目 -> 上下文菜单 -> 属性 -> 项目方面 -> JPA

在此处输入图片说明

Then click further configuration available..然后单击可用的进一步配置..

在此处输入图片说明

Then you set DB connection by clicking add connection.. Link然后您通过单击添加连接设置数据库连接.. 链接
Choose connection profile types选择连接配置文件类型

在此处输入图片说明

Then set connection details然后设置连接详细信息

在此处输入图片说明

The above answer is correct, but if you're missing the JPA Facet in your project properties, you should do this上面的答案是正确的,但是如果您的项目属性中缺少 JPA Facet,则应该这样做

Go to help -> install new software转到帮助 -> 安装新软件

Search for JPA搜索 JPA

Select Web, XML, Java EE and OSGi Enterprise Development and install选择 Web、XML、Java EE 和 OSGi Enterprise Development 并安装

Restart Eclipse重启 Eclipse

Also see Not able to create or convert a project in to JPA Project另请参阅无法创建项目或将项目转换为 JPA 项目

Right click on project and go to右键单击项目并转到

Configure -> Convert to JPA Project配置 -> 转换为 JPA 项目

Then you will be able to see the JPA Tools in menu然后您将能够在菜单中看到JPA 工具

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM