Java 数据库错误(抽象模式类型未知)
Java Database Error (the abstract schema type is unknown)
我在尝试创建登录菜单时收到此错误消息,在此之前没有问题。不知道从什么时候开始出现这个问题,也没有错误提示。
[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.
如果您的 class 是这样的:
@Entity
@Table(name = "Admin_1")
public class Admin {
@Column(name = "ADMIN_REGISTER_DATE")
private Date adminRegisterDate;
......
}
并且您在 JPQL 中使用对象字段 (a.adminRegisterDate),您需要在查询中使用 classname "Admin" 而不是 "Admin_1"。
SELECT a FROM Admin a WHERE a.adminRegisterDate = :adminRegisterDate
我在尝试创建登录菜单时收到此错误消息,在此之前没有问题。不知道从什么时候开始出现这个问题,也没有错误提示。
[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.
如果您的 class 是这样的:
@Entity
@Table(name = "Admin_1")
public class Admin {
@Column(name = "ADMIN_REGISTER_DATE")
private Date adminRegisterDate;
......
}
并且您在 JPQL 中使用对象字段 (a.adminRegisterDate),您需要在查询中使用 classname "Admin" 而不是 "Admin_1"。
SELECT a FROM Admin a WHERE a.adminRegisterDate = :adminRegisterDate