Hi guys, in this lesson we will talk about GPA. You pull stories in springboard. One of the best advantage of spring bird is auto configuration. And one of them is Java Persistence API repository. You know that in most case, generally, we use typical generation operations on repositories. For example, create operation, update operation, delete operation and select operation.
In simply birth GP repository is used for these kind of generic crude operations. So use it, we just need to extract it on our personal class with entity model and ID field off and the class. After we extend it, we can use many repository operations with GP repository. Automatically, these are find by ID save, delete, find all, delete all save all, etc. Most of cases, these methods will be enough for us. But in some cases, these methods could not be enough for us in GP repository.
We can also describe leave queries or new methods. For example, we have a user entity and this entity has ID, username, password, blah, blah, blah fields. And we want to find user according to username field to do it in GP repository. We don't need extra query. We can do it with find by plus field name methods because GP reports can parse method names to queries like find by Id find by username, find by password, etc. Other things about GP repository, we can create new queries with query annotation.
For example, we want to find maximum ID in user table. To find it, we can write a query like silic max ID from user with clear annotation. Last thing about GP post study, we can customize delete or update operations with methods or queries. methods will be similar like other setting operations, but three years query we should add modify annotation to methods because the operations will need commit execution after queries. Of course, there are other many things in GP repository, but for beginning for our course, this will be enough. That's all.
Thank you.