1- Identify the POJOs that have a database representation
2- Identify which properties of those POJOs need to be persisted
3- Create Hibernate XML mapping files for each of the POJOs that map properties to columns in a table.
4- Create the database schema using the schema export tool, use an existing database, or create your own database schema .
5- Add the Hibernate Java libraries to your application’s classpath .
6- Create a Hibernate XML configuration file that points to your database and your XML mapping files.
7- In your Java application, create a Hibernate Configuration object that references your XML configuration file.
8- Also in your Java application, build a Hibernate SessionFactory object from the
Configuration object.
9- Finally, retrieve Hibernate Session objects from the SessionFactory, and write your data access logic for your application.
No comments:
Post a Comment