• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

org.hibernate.QueryException!

 
Ranch Hand
Posts: 1277
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?

 
Ranch Hand
Posts: 856
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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....
reply
    Bookmark Topic Watch Topic
  • New Topic