Posts

Showing posts from April, 2013

Eclipse - Tips & Tricks

This article is for those who use Eclipse. Keyboards shortcuts are very important for comfortable and quick editing. Here are the list of most important shortcuts in Eclipse : For a full list of shortcuts, you can also check by pressing Ctrl+Shift+L. Ctrl +3 Focus into the Quick Access search box which allows you to execute any Eclipse command. Ctrl+SHIFT+T Search dialog for Java Type, Start typing the name and the list gets smaller. Try typing the capital letters of the class only (e.g. type "NPE" to find "NullPointerException") Ctrl+SHIFT+R Search dialog for resources, e.g. Xml files, text files, or files of any other type. Ctrl+E Open Editor Drop down, Presents a popup window listing currently opened files. Ctrl+O Quick Outline, Show all methods of the current class, Press Ctrl+O a second time to include inherited methods. Ctrl+SHIFT+space Context Information Ctrl+Shift+O Organize Imports, Adjusts the imports ...

Hibernate Configuration

To inform Hibernate from where to find mapping information of Java classes to database tables or configuration setting related to database, All such information is usually supplied by Hibernate Configuration Object. It is managed by an instance of org.hibernate.cfg.Configuration. An instance of org.hibernate.cfg.Configuration represents an entire set of mappings of an application’s Java types to an SQL database. The mappings are compiled from various XML mapping files or from Java 5 Annotations. Hibernate provides following types of configurations hibernate.cfg.xml – A standard XML file which contains hibernate configuration and which resides in root of application’s CLASSPATH  hibernate.properties – A Java compliant property file which holds key value pair for different hibernate configuration strings.  Programmatic configuration – This is the manual approach. The configuration can be defined in Java class.  1. hibernate.cfg.xml : The hibernate.cfg.xml file...

What is Hibernate ?

Image
What is Hibernate ? Hibernate is an  open source java based library used to work with relational databases.  The term Object/Relational Mapping refers to the programming technique for converting data between relational databases and object oriented programming languages such as Java, C# etc. It is a very powerful ORM solution build on top of JDBC API. It was initiated by Gavin King in 2001. It is a persistence framework which is used to store and retrieve data from database. It is a powerful, high performance Object-Relational Persistence and Query service for any Java Application Hibernate  makes use of persistent objects called POJOs (Plain Old Java Objects). Hibernate maps Java classes(POJO) to database tables and from Java data types to SQL data types and relieve the developer from 95% of common data persistence related programming tasks. These objects works as a data carrier called DTO (Data Transfer Object). They are used to carry data between diffe...