First let us know, what are the important interfaces ans classes. The following are the most important interfaces and classes.
The following are the steps which will be used to develop Hibernate Application:
Fig: Important interfaces and classes in Hibernate |
The following are the steps which will be used to develop Hibernate Application:
- Create Configuration object by using configuration class.
- Call the configure() method using the above configuration object.
- Get SessionFactory object by using configuration object by using "buildSessionFactory()" method.
- Get Session object using SessionFactory object, by calling openSession() method.
- Get Transaction object by calling the method beginTransaction().
- Create the POJO class object corresponding to the table.
- Store the data in the form of object.
- Ask Hibernate to perform CURD operations.The following are the curd operations. The following are the operations.
- save() // create
- update() // update
- load() // select /Retrieve
- delete() // delete
- End the Transaction by calling commit() and rollback().
- Close the session object.
- Close the SessionFactory object.
Fig: Hibernate application to Insert Record into Employee table |
No comments:
Post a Comment