Hibernate “Session” is the persistence manager for the
application.
The instance of the Session class shall be retrieved from
the “SessionFactory” class.
SessionFactory sessionFactory = new
Configuration().configure().buildSessionFactory();
The call to the configure() method loads the
hibernate.cfg.xml file and initialize the Configure instance.
SessionFactory is immutable class. SessionFactory is usually
only build once at the start of the servlet.
Hibernate can access Public,Prive,Protected fields/methods.
No argument constructor is mandatory for each class as
Hibernate has to create instance of the class using Java Reflections.
The Type attribute in
the mapping file is not the type of Java or SQL. It is the mapping data type of
hibernate.
The default column mapping is to name field of the property
in not mentioned explicitly.
No comments:
Post a Comment