JDBC VS Spring JDBC VS JPA VS Spring Data JPA

  •  JDBC:
    • write lot of sql queries(delete form table where id=?)
    • And write lot of java code as well
  • Spring JDBC:
    • write lot of sql queries(delete form table where id=?)
    • But Lesser Java Code
  • JPA:
    • Do not Wory about the Queries
    • Just Map Enties to tables
  • Spring Data JPA:
    • Lets Make JPA even more simple
    • Spring Data JPA will take care of everything
  1. Differance between Hibernate and JPA
    1. JPA Defines a Specification.
    2. JPA is an API
    3. JPA is Like Interface
    4. JPA define how you can define an entities
      1. By Using an @Entity Annotation to define any class as Entity or as table mapping
      2. By Using an @Id Annotation to define primary key
      3. By Using an @Column Annocation to define attribute of the class
  2. Hibernate is one of the popular implementation of JPA
    1. we can use JPA rather than to lock in to hibernate or other implementation of JPA like toplink etc

Comments

Popular posts from this blog

Introduction of RESTful Web Service

Learn JPA and Hibernate

Implementing Dynamic Filtering for Rest API