Hibernate with Annotations.


   Here, no need to create .hbm.xml instead we use annotations to do ObjectRelationalMapping.
 to use annotations we have to use hibernate.commons.annotations.jar,ejb3.persistence.jar and hibernate-annotaitons.jar files.

 Start by creating class Classname
@Entity   Mark class as entitybean
@Table(name="tablename")
public class Classname
{
          variables;
         Constructors;
    @Id  Identifier property
    @ Generated value   
    @ Column(name="colname")         Map to table column
     get and set methods for that variable which mapped to column name
  @Column(..
   .
   .
}

Instead of adding .hbm.xml to .cfg.xml add fully qualified name of annoted class.

in .cfg fille, <mapping class="...classname"/>
Session Facade in util class should be configured using annotation configuration object instead of configuration object..