The Hibernate architecture has 3 main components:
- connection management
- transaction management
- object-relational mapping
The Hibernate Session is the main runtime interface between a Java application and Hibernate. SessionFactory allows the application to create a Hibernate Session by reading the configuration from hibernate.cfg.xml.
Important elements of the Hibernate mapping file include the following:
- <hibernate-mapping> root element
- <class> maps classes to DB entities
- <id> maps to the primary key of a table
- <generator> is used to generate the primary key for a new record. Values include increment, sequence, and assigned
- <property> maps attributes to columns
Hibernate also supports native SQL statements.
0 comments:
Post a Comment