getHibernateTemplate().save(object) return value ?

I am inserting an object into the database using the

getHibernateTemplate().save(object)

Does the above return any value. Probably something like a 0 or 1 such that based on the correct insert I can do my business logic.

Or does it throw an exception if an insert does not happen

[306 byte] By [hemanthjavaa] at [2007-11-27 5:41:18]
# 1

It will throw a data access exception arising from the underlying Hibernate exception if you can't save the object. Once you've thrown a Hibernate exception, you must not re-use the Hibernate session.

When successful, the method returns the primary key field for the object.

Consult the very comprehensive API documents next time you have this sort of question please:

http://www.springframework.org/docs/api/

dcmintera at 2007-7-12 15:18:39 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...