Monday, 17 February 2020

NoRepositoryBean annotation spring boot

import org.springframework.data.repository.NoRepositoryBean;
import org.springframework.data.repository.Repository;
 
import java.io.Serializable;
import java.util.Optional;
 
@NoRepositoryBean
public interface BaseRepository<T, ID extends Serializable> extends Repository<T, ID> {
 
    Optional<T> deleteById(ID id);
}


Annotate the created interface with the @NoRepositoryBean annotation. This ensures that Spring Data JPA won’t try to create an implementation for the BaseRepository interface.

links for Data Structure

  1) 𝐁𝐞𝐜𝐨𝐦𝐞 𝐌𝐚𝐬𝐭𝐞𝐫 𝐢𝐧 𝐋𝐢𝐧𝐤𝐞𝐝 𝐋𝐢𝐬𝐭:  https://lnkd.in/gXQux4zj 2) 𝐀𝐥𝐥 𝐭𝐲𝐩𝐞𝐬 𝐨𝐟 𝐓𝐫𝐞𝐞 𝐓𝐫𝐚𝐯𝐞𝐫𝐬𝐚𝐥𝐬...