Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
[b]Hibernate version:3.0[/b]
[b]Mapping documents:[/b]
[b]Code between sessionFactory.openSession() and session.close():[/b]
[b]Full stack trace of any exception that occurs:[/b]
[b]Name and version of the database you are using:postgresql 8.0[/b]
[b]The generated SQL (show_sql=true):[/b]
[b]Debug level Hibernate log excerpt:[/b]
Hi all,
I'm actually having a problem when calling session.update method. Here is a description of my problem. I have a class 'Customer' and my corresponding table 'customer' in my database in which i have a row with id=1 and name='test'. I then do the following to update the row with id=1:
Customer c = new Customer(1, "test1");
session.update(c);
I got an exception, ClassNotfoundException NotUniqueObjectFound as soon as I call session.update(c). But the strange thing is that at times the update is done correctly. Why I got the exception?
In fact to update an object I found that I should get an instance of the object first by calling session.get(ClassName, UniqueIdentifier) not by doing a newInstance(). Why?
Thanks in advance