Java数据库错误(抽象模式类型未知)

时间:2018-08-15 11:25:17

标签: java database schema abstract

在尝试创建登录菜单时,出现此错误消息,然后才没有问题。不知道什么时候发生此问题,并且没有错误通知。

[EL Info]: 2018-08-15 19:16:20.494--ServerSession(15826265)--EclipseLink, version: Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd
[EL Info]: connection: 2018-08-15 19:16:20.624--ServerSession(15826265)--file:/C:/Users/Tan Jun Wen/Documents/NetBeansProjects/JavaProgramming2_Assignment/build/classes/_Investment company databasePU logout successful
[EL Severe]: ejb: 2018-08-15 19:16:20.627--ServerSession(15826265)--Exception [EclipseLink-0] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.JPQLException
Exception Description: Problem compiling [SELECT a FROM Admin_1 a WHERE a.adminRegisterDate = :adminRegisterDate]. 
[14, 21] The abstract schema type 'Admin_1' is unknown.
[30, 49] The state field path 'a.adminRegisterDate' cannot be resolved to a valid type.

1 个答案:

答案 0 :(得分:0)

如果您的班级是这样的:

@Entity
@Table(name = "Admin_1")
public class Admin {

@Column(name = "ADMIN_REGISTER_DATE")
private Date adminRegisterDate;
......
}

在JPQL中使用对象字段(a.adminRegisterDate)时,需要在查询中使用类名“ Admin”而不是“ Admin_1”。

从管理员那里选择a.adminRegisterDate =:adminRegisterDate