Skip to content

The difference with JpaRepository is that GenericRepository doesn't need to be a spring project in order to use it. That is, it can be easily used in simple build tools like Maven or Gradle without spring. Very easy to use and lightweight.

Notifications You must be signed in to change notification settings

Nurislom373/GenericRepository

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GenericRepository

The GenericRepository Class is Difference method with Spring JpaRepository The difference with JpaRepository is that GenericRepository doesn't need to be a spring project in order to use it. That is, it can be easily used in simple build tools like Maven or Gradle without spring. Very easy to use and lightweight.

We can add these 4 configurations to the application.properties file

generic.username=postgres
generic.password=test
generic.host=localhost:5432
generic.database=test

The main class we need is GenericRepository<T, ID>

public class GenericRepository<T, ID> {
}
public class AuthRepo extends GenericRepository<AuthUser, Integer> {
}

New Feature @Table Annotattion Usage

@Table(name = "auth_user", schema = "public")
public class AuthUser {
    private Integer id;
    private String name;
    private String password;
}

About

The difference with JpaRepository is that GenericRepository doesn't need to be a spring project in order to use it. That is, it can be easily used in simple build tools like Maven or Gradle without spring. Very easy to use and lightweight.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages