O'Reilly logo

Spring Persistence with Hibernate by Ahmad Seddighi

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Some useful Session methods

At the beginning of this chapter, we introduced different methods exposed through the Session interface. Some of these methods have been discussed in this chapter, while others are fully explained in other chapters. However, there are some useful methods that fit into this chapter's scope. These methods may be used any time when working with a Session object or objects managed by the Session instance. The following table summarizes the Session's methods:

Method

Description

void persist(Object transientObject)

Takes a transient object as an argument and associates it with the current session. The session tracks the object's changes and synchronizes the object with the database when Hibernate commits the transaction ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required