Hibernate Crud Methods and Generator Class
Hibernate Crud Methods and Generator Class
__________________________________________________________
we can change it
multiple db
-------------
here we will create 2 configuration files
oracle.cfg.xml
mysql.cfg.xml
//client code
Configuration config1=new Configuration().configure
("oracle.cfg.xml");
SessionFactory factory1=config1.buildSessionFactory();
Session session1=factory1.getCurrentSession();
Session session2=factory2.getCurrentSession();
_______________________________________________________
**Generator classes
------------------
generator class is used to autogenerate the values for POJO identity/PK
1)assigned -programmer will supply the value
eg:-<generator class="assigned"/>
8)hilo-auto unique values but always new value wud be greater than old value
min-low=1200
1222 1250 1263 1289
Lab)
Book-->bookCode,title,author,publicationDate