[nbj2ee] Problem with column name and entity class

  • From: "zenos14" < >
  • To:
  • Subject: [nbj2ee] Problem with column name and entity class
  • Date: Sat, 21 Apr 2012 21:30:48 +0000

I'm having some trouble with a project of mine. It's a CRUD web application 
for a database. The problem is that one of the columns have to be year and 
when I go to the list page I get an javax.ejb.EJBException error and the 
stack trace 

> Caused by: Exception [EclipseLink-4002] (Eclipse Persistence Services - 
> 2.0.1.v20100213-r6600): org.eclipse.persistence.exceptions.DatabaseException
> Internal Exception: java.sql.SQLSyntaxErrorException: Syntax error: 
> Encountered "year" at line 1, column 33.
> Error Code: -1
> Query: ReadAllQuery(referenceClass=TblBook sql="SELECT ID, AUTHOR, TITLE, 

I had a similar problem with my last project and it was solved by changing 
the query a bit but I cant figure out what I'm supposed to change here

the named query it uses is 

@NamedQuery(name = "TblBook.findByYear", query = "SELECT t FROM TblBook t 
WHERE t.year = :year"

but my attempts to change it have done nothing

If anyone can point me in the right direction I would be very thankful.

[nbj2ee] Problem with column name and entity class

zenos14 04/21/2012

Project Features

About this Project

www was started in November 2009, is owned by jpirek, and has 25 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20150226.965aeb8). © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
Please Confirm