Monday, December 31, 2012

General flow of Hibernate communication with RDBMS?

  • Load the Hibernate configuration file and create configuration object. It will automatically load all hbm mapping files
  • Create session factory from configuration object
  • Get one session from this session factory
  • Create HQL Query
  • Execute query to get list containing Java objects
Reference:- http://alltechinone.in

What is Hibernate?

Hibernate is a pure Java object-relational mapping (ORM) and persistence framework that allows you to map plain old Java objects to relational database tables using (XML) configuration files. Hibernate not only takes care of the mapping from Java classes to database tables (and from Java data types to SQL data types), but also provides data query and retrieval facilities that can significantly reduce development time otherwise spent with manual data handling in SQL and JDBC.
There are several benefits of using Hibernate
  • Powerful object-oriented hibernate query language
  • Descriptive O/R Mapping through mapping file.
  •  Hibernate cache : Session Level, Query and Second level cache.
  • Transparent persistence based on POJOs without byte code processing
  • Automatic primary key generation
  • Performance: Lazy initialization, Outer join fetching, Batch fetching

linux command — “tail”: most basic use

There is most basic but powerful use of linux “tail” command. I mostly use this command to see the log files which are constantly growing.
>tail -100f catalina.out
The above use provides me a way to keep an eye on catalina.out file while it is getting updated constantly during the tomcat server start up. It always shows me last 100 lines in the catalina.out. To come out of the log view one should press CTRL+C.
The above command can be used to see the last specified number of lines of log files or any file which are getting updated by any other process.