wood burning stoves 2.0*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes org.hibernate.QueryException! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "org.hibernate.QueryException!" Watch "org.hibernate.QueryException!" New topic
Author

org.hibernate.QueryException!

Niranjan Deshpande
Ranch Hand

Joined: Oct 16, 2005
Posts: 1277
I am trying to persist an entity into HSQL database. I have a stateless session bean that fetches/cleans the list of operations performed on two operands, and also uses DI (another stateless session bean) to manipulate the operands mathematically.

When I run the client (java app), i get this exception for the entity class -

Caused by: org.hibernate.QueryException: could not resolve property: timestamp of: com.example.Operation

My entity is as follows:





I tried to use a different name for the table as seen in the commented code at the top of class. But I got an exception saying something about the mapped name. So i settled for the default name.

Can any one help me on the above issue?

My bean is



I am not sure why the exception says the property to be timestamp whle my bean and entity use timeStamp


SCJP 1.4 - 95% [ My Story ] - SCWCD 1.4 - 91% [ My Story ]
Performance is a compulsion, not a option, if my existence is to be justified.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

One thing. I think it would be better to give your field a different name. "timestamp" may be a reserved word for some databases.

I tried to use a different name for the table as seen in the commented code at the top of class. But I got an exception saying something about the mapped name

What exception ?


[My Blog]
All roads lead to JavaRanch
Niranjan Deshpande
Ranch Hand

Joined: Oct 16, 2005
Posts: 1277
This time I tried making these changes-

used @Column(name = "OPERATION_TIMESTAMP") on the getter method of the time stamp property.
renamed the property to timeStamped.

But I still get the same exception.

The HSQL database showed the col. name as TIMESTAMP when I did a select * from Operation!

If I want the property to be named as OPERATION_TIMESTAMP why is HSQL using its own name?

Amandeep Singh
Ranch Hand

Joined: Jul 17, 2008
Posts: 844
it might be possible, the previous table created by you 'Operation ' still existis in database.
So deploying the jar, might not be allowing the persistence provider to overrider the existing table.

Try to manually delete the table from database.
Then try to deploy the jar. Then see how it goes....


SCJP 1.4, SCWCD 5, SCBCD 5, OCPJWSD 5,SCEA-1, Started Assignment Part 2
My blog- http://rkydesigns.blogspot.com
 
jQuery in Action, 2nd edition
 
subject: org.hibernate.QueryException!