File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

org.hibernate.QueryException!

 
Niranjan Deshpande
Ranch Hand
Posts: 1277
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

 
Christophe Verré
Sheriff
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ?
 
Niranjan Deshpande
Ranch Hand
Posts: 1277
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 850
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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....
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic