简体   繁体   English

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

[英]Java Database Error (the abstract schema type is unknown)

I got this error message when I try to create my login menu, before that there is not problem. 尝试创建登录菜单时,出现此错误消息,之前没有问题。 Don't know since when this problem occur and there is no error notice. 不知道什么时候发生此问题,并且没有错误通知。

[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.

If your class like this: 如果您的班级是这样的:

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

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

And you working with object fields (a.adminRegisterDate) in JPQL, you need use classname "Admin" and not "Admin_1" in query. 而且,您在JPQL中使用对象字段(a.adminRegisterDate)时,需要在查询中使用类名“ Admin”而不是“ Admin_1”。

SELECT a FROM Admin a WHERE a.adminRegisterDate = :adminRegisterDate 从管理员那里选择a.adminRegisterDate =:adminRegisterDate

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

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