NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Problem with column name and entity class

 
Post new topic   Reply to topic    NetBeans Forums -> Java EE Users
View previous topic :: View next topic  
Author Message
zenos14



Joined: 21 Apr 2012
Posts: 1

PostPosted: Sat Apr 21, 2012 9:29 pm    Post subject: Problem with column name and entity class Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> Java EE Users All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo