Saving Data with Hibernate6:23 with Chris Ramacciotti
This lesson demonstrates the use of a Hibernate `SessionFactory` to save a new entity to the database.
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:
Using Github With This Course
You can complete this course entirely using code created by you on your local machine. However, if you choose to use the code I've made available to you, you have two options:
- Use the project files linked at the bottom of this page, or
- Use the Github repository I've made available (recommended)
If you choose the recommended option of using the Github repository, it can be found at
To utilize Github with this course, you can download the Github desktop client for your system or use the command line interface provided with Git.
Clone this repository to your machine using the Github desktop client, or using the following command:
git clone firstname.lastname@example.org:treehouse/contactmgr-hibernate.git
To update your local repository to match a video's starting point, you can use the
git checkout ... command in combination with the stage and video number. For example, to update your local repository to match the starting point of Stage 5, Video 4, you'd use the following:
git checkout -f s5v4
Notice the use of the -f option. This forces Git to override all local changes, so be aware: this will cause any changes you made to be lost.
You need to sign up for Treehouse in order to download course files.Sign up