NetBeans Forums
| View previous topic :: View next topic |
| Author |
Message |
zenos14
Joined: 21 Apr 2012 Posts: 1
|
Posted: Sat Apr 21, 2012 9:29 pm Post subject: Problem with column name and entity class |
|
|
Hello,
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
| Quote: | 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
Call: SELECT ID, AUTHOR, TITLE, ISBN, year, PUBLISHER FROM TBL_BOOK
Query: ReadAllQuery(referenceClass=TblBook sql="SELECT ID, AUTHOR, TITLE, ISBN, year, PUBLISHER FROM TBL_BOOK") |
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. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|