Hi guys, in this lesson we will create our repository class for users. To do it, first of all, let's create a new package under our main package. Our package name will be repository. And the repository package we will create user repository interface. User repository will extend GPA repository. GPA repository is an abstract class implemented by sitting GPA requests pasta with gp ghostery simply put We'll handle basic crude database operations like save, update, find by ID delete, etc.
GP repository has two generic parameters. first parameter is for the model class. second parameter is for the ID class of model class. So our model class will be usage and our ID class will be long. Okay, now we can create queries in user repository. Our first query will be finding users according to username.
You know that username is a field of user table. So in GP repository, we can find it we Using find by class field name, so in our case, we can find it like find by username, and our parameter will be username. Okay, we want to describe a Neve query and we want to describe it with using h queer. Let's write a query about finding names of users. According to idealist. Our method name will be find by idealist.
And our parameter will be user idealist. In GPA repository, we can write HTML with query annotation. Okay, that's all about user repository implementation. Thank you