An introduction to Hibernate
Hey all, I am gonna talk abt Hibernate..!!! Its a java persistence frame work. In simple words its an ORM tool.
Whats ORM and whats an ORM tool..?? ORM stands for Object Relational Mapping..its mapping between objects and database. we normally use JDBC to talk 2 database from Java. Using an ORM tool like Hibernate we map java objetcs to Database. In Hibernate tables are denoted as classes and relationships are denoted by objects. there are a few terms we need to understand when we are using Hibernate.
- POJO Classes- Plain Old Java Objects
These are java equivalent of the database tables, the columns in the tables are represented as member variables of the particular class with access specifer Private..all these member variables willl have getter and setter methods. The class also consists of a default constructor .We normaly add two parametrised constructors. one consisting of all the members in the class another consisting of member variables which are mandatory(ie: columns which are NOT-NULL in table).
- HBM- Hibernate Mapping File
An xml file defining the table structure.using the various tags available, we can define the entire schema.
- Hibernate CFG -configuration file
Using the Configuration file we can specify the dilaect, the schema to which we need to connect, the driver to be used, the connection pool size etc etc.
-
Archives
- February 2012 (1)
- July 2009 (1)
- June 2009 (1)
- May 2009 (7)
-
Categories
-
RSS
Entries RSS
Comments RSS