All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.codingapi.springboot.fast.jpa.repository.BaseRepository Maven / Gradle / Ivy

package com.codingapi.springboot.fast.jpa.repository;

import org.springframework.core.ResolvableType;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.repository.NoRepositoryBean;

@NoRepositoryBean
public interface BaseRepository extends JpaRepository {

    @SuppressWarnings("unchecked")
    default Class getEntityClass() {
        ResolvableType resolvableType = ResolvableType.forClass(getClass()).as(BaseRepository.class);
        return (Class) resolvableType.getGeneric(0).resolve();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy