repository 标记接口:为空
定义:public interface Repository<T ,ID extends Serializable>
【Responsitory类的定义:】
public interface Repository<T,ID extends Serializable>{}
1)Responsitory是一个空接口,标记接口
没有包含方法的声明接口
2)我们定义的接口 ** extends Repository,表示此接口纳入spring管理,需按一定规则定义方法
如果我们自定义的接口没有extends Repository运行时会报错:
org.springframework.beans.factory.NoSuchBeanDefinitionException:No qualifying bean of type 'com.imooc.repository.**' available
3)添加注解能达到不用extends Repository的功能
@RepositoryDefinition(domainClass = **.class,idClass=Integer.class)
关于Repository接口
【Responsitory类的定义:】 public interface Repository<T,ID extends Serializable>{} 1)Responsitory是一个空接口,标记接口 没有包含方法的声明接口 2)我们定义的接口 ** extends Repository,表示此接口纳入spring管理,需按一定规则定义方法 如果我们自定义的接口没有extends Repository运行时会报错: org.springframework.beans.factory.NoSuchBeanDefinitionException:No qualifying bean of type 'com.imooc.repository.**' available 3)添加注解能达到不用extends Repository的功能 @RepositoryDefinition(domainClass = **.class,idClass=Integer.class)
Repository类:标记接口
@RepositoryDefinition(domainClass = Employee.class,idClass=Integer.class)
Repository接口讲解
Repositoy 标记接口
Repository接口讲解
Repository接口说明
Repository接口说明
.
Repository接口相关知识点
Spring Data Repository接口