SpringDataJPA-Practice
SpringDataJPA-Practice
ownerRepository.findbyID(id)
ownerRepository.save()
ownerRepository.delete(id)
however if you want to use other fields of the Entity class for searching than
we can use
Optional<Owner> findbyStatus();
Or
Optional<Owner> findbyStatusandAnotherfield();
If you want to use any other complex queries you can use
@Data
Class Owner{
@Generated
@Query(name = “”)
Or
Optional<Owner> findbyStatusandAnotherfield();
One to one
One to many
Many to many
@Entity
@GeneratedValue
For social media apps facebook twitter etc we will use optimistic locking
For banking applications financial ecommerce and airline booking etc we can use pessimistic
locking