getting sql exception when using EJB 3.0 with Java Persistence API
Hi,
On my PC when I run the sample applications in Java EE tutorial I don't get any errors. But, when I try to run my own code, then I get the SQL exception. I paste the exception stacktrace below.
The exception says that the column is not present. But, the column is actually present. The named query I used is:
@NamedQuery(name = "Book.findAll", query = "SELECT b FROM Books b");
Could any one please help on this?
========================================================
Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2006.4 (Build 060412)): oracle.toplink.essentials.exceptions.DatabaseException
Internal Exception: org.apache.derby.client.am.SqlException: Column 'BOOKID' is either not in any table in the FROM list or appears within a join specification and is outside the scope of the join specification or appears in a HAVING clause and is not in the GROUP BY list. If this is a CREATE or ALTER TABLE statement then 'BOOKID' is not a column in the target table.Error Code: -1
Call:SELECT bookid, author, price, title, inventory, catagory FROM BOOKS WHERE (catagory = CAST (? AS VARCHAR(32672) ))
bind => [Technical]
Query:ReportQuery(cart.Books)
at oracle.toplink.essentials.exceptions.DatabaseException.sqlException(DatabaseException.java:303)
at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:551)
at oracle.toplink.essentials.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:437)
at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.executeCall(UnitOfWorkImpl.java:1355)
at oracle.toplink.essentials.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:213)
at oracle.toplink.essentials.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:199)
at

