Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Start a free Courses trial
to watch this video
This lesson demonstrates the use of a Hibernate `SessionFactory` to save a new entity to the database.
Note:
The .save()
method in Hibernate is now deprecated. It still functions as expected, though you may see warnings in your IDE. For newer implementations, it's recommended to use the .persist()
or .merge()
methods, which offer similar functionality.
Java Transaction API Dependency
Though I included the JTA library in the Gradle build file as a compile-time dependency, you could instead list it as a runtime dependency, since no source code references the library:
runtime 'javax.transaction:jta:1.1'
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up