Posts

Showing posts from December, 2021

Hibernate ORM

Image
  priviously we used to create Data access Object then write sql query to perform then take each value from object and then perform SQL operation on it. > Using Hibernate we don't need to create DAO object for storing data and then use query in it.     here it is done automatically by hibernate all we need to do is while creating class we map it with table in database . In backend Hibernate creates JDBC query for us and performs actions as asked by us. Mapping can be done either by XML or Annotation. > Implementation in Eclipse: adding hibernate and sql-connector dependency. After copying dependency update Maven project so it will download all required dependency. Also Right click on project-> properties -> Java build path -> Add library -> select Deafault JRE. > Configuring Hibernate XML file :  will have to create xml file with name : hibernate.cfg.xml this will be stored in com/src/java folder so our program can automatically detect it else wi...