Day 10 - JPA and Hibernate(Hibernate Specific)

 

  1. Hibernate Annotation Configuration Tutorial with Complete Example using PostgreSQL
  2. Maven
  3. GIT
  4. GitHub
  5. Hibernate Locking and Caching
  6. Hibernate Criteria Queries
  7. JPA Criteria API
  8. Hibernate Query Language (HQL)
  9. Inheritance Strategies with JPA and Hibernate
  10. Hibernate Extensions
  11. List of annotations used in JPA and Hibernate
Question:
1. Create new Java project
2. Convert it to maven project
3. Add JPA, Hibernate, and JDBC dependencies
4. Replace the traditional hibernate.cfg.xml configuration file with a Java-based configuration using the Configuration class in Hibernate or by leveraging the SessionFactory setup programmatically.
5. Create entity class Candidate with attribute Id (primary key) and name
6. Insert data into database table


7. Create new column mark (data type int) 
8. Insert five rows
     1. Name: "June" , mark: 67 
     2. Name: "April", mark: 90
     3. Name: "Tom", mark: 80
     4. Name: "Spike", mark: 70
     5. Name: "Sibin", mark: 50
9. After insert five rows, fetch(list) all candidate from database using HQL query and print
10. Then fetch all candidate whose age is mark is greater than 75 and print
11. Then find candidate by id(2) and print candidate 
12. Update candidate whose id = 2 and set new name = "Gayathri"
13. Delete candidate whose id = 1

Comments