【问题标题】:Table does not exist error despite I have it尽管我有表,但表不存在错误
【发布时间】:2013-04-18 07:17:15
【问题描述】:

当我使用实体管理器提交时,出现以下错误: 实体标题存在并且没有任何错误可能是此错误的原因

表/视图“S1_MANAGER”不存在。

发生在我提交的时候。

entityManager.getTransaction().commit();


@Entity
@Table(name = "S1_MANAGER")
public class manager 
{
    @Id 
    @Column(name = "title_id", length = 128)    
    private String Id;

顺便说一句,该表也存在于持久化 xml 中。

【问题讨论】:

  • 该表存在于persistence.xml - 但它是否也存在于您的数据库中?
  • persistence.xml 中如何存在表?那里没有指定它的地方。你是说 orm.xml 吗?
  • @Averroes-我应该怎么做?
  • 打开 eclipselink 日志以查看您连接到的位置以及使用的 SQL,如下所述:wiki.eclipse.org/EclipseLink/Examples/JPA/Logging 确保您连接到具有表的数据库和模式。如果这没有帮助,请显示日志和 persistence.xml 并描述您如何知道该表存在

标签: java jpa eclipselink entitymanager


【解决方案1】:

确保数据库中存在您要连接的用户/模式的表。

要自动创建表格供您查看,

http://wiki.eclipse.org/EclipseLink/Examples/JPA/DDL

【讨论】:

    猜你喜欢
    • 2016-05-09
    • 1970-01-01
    • 2017-05-20
    • 1970-01-01
    • 2014-01-08
    • 2020-12-25
    • 2022-12-31
    • 2015-01-02
    • 1970-01-01
    相关资源
    最近更新 更多