Hibernate notes
hibernate
1. hibernate
2.
crud
jdbc jdbc
orm
1. hidernate
2.
3. orm object relational mapping,
1.
2.
hibernate
hibernate
hibernate
jar
1. hibernate
1.
hbm. xml
2.
dtd,schema,
3.
hibernate
1.
src
hibernate. cfg. xml
2.
figuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
" http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd ">
3. hibernate
hibernate
hibernate
SessionFactory
SessionFactory
crud
Hibernate
Configuration
1.
Configuration cfg = new Configuration();
cfg. configure();
Session Factory
Session
session
session
1.
2.
3.
4
session
Transaction
1.
Transaction tx = session. beginTransaction();
tx.commit();
tx.rollback();
1.
2.
3.
4.
hibernate
id
session
//
User user = new User();
user. setUsername("
user. setPassword("250");
user. setAddress("
//
session. save(user);
1
1.
2.
3.
hibernate
hibernate