Introduction to Hibernate

12/14/10
Posted by Fulto

we can use the techlologies like JDO( Java Data Object) , Hibernate , toplink etc for accessing the databases.
All these technologies internally uses JDBC API.
A developer can save lot of time during the development by using Hibernate/JDO/TOPLINK etc.. instead of directly making use of JDBC API.
Hibernate called as Object Relational Mapping Technologies (ORM Technologies).

The data that is stored in the database tables managed by the RDBMS Servers is called as "Realtional Data".
To use Hibernate we must provide the files called as "hbm" files (Hibernate Mapping Files).In that "hbm" files we must provide the following details.
1) The mapping between the database table and the java class.
2) The mapping between the columns of a database table and the properties of the java class that is mapped to the table.

package org.myfulto;
public class Employee
{
private Long empNo;
private String empName;
private String address;
private Float salary;
// setters and getters supporting the follwoing properties
//empNo, empName, salary and address.
public void setEmpNo(Long empno)
{
this.empNo=empno;
}
public String getEmpNo()
{
return this.empNo;
}

public void setEmpName(String empName)
{
this.empName=empName;
}

public  String getEmpName()
{
return this.empName;
}
public void setaddress(String addr)
{
this.address=addr;
}

}

People who read this post also read :



Labels:

0 comments: