-
PagingAndSortingRespsitory 支持分頁和排序功能的接口
查看全部 -
CrudRepository接口
查看全部 -
注解@Query的使用
查看全部 -
Repository查詢規(guī)則
查看全部 -
Repository查詢規(guī)則
查看全部 -
Repository子接口:
1、CrudRepository:繼承Repository,實現(xiàn)了CURD相關(guān)的方法
2、PagingAndSortingRepository:繼承CrudRepository,實現(xiàn)了分布排序相關(guān)方法
3、JpaRepository:繼承PagingAndSortingRepository,實現(xiàn)JPA規(guī)范相關(guān)的方法
查看全部 -
【Responsitory類的定義:】
public interface Repository<T,ID extends Serializable>{}
1)Responsitory是一個空接口,標記接口
沒有包含方法的聲明接口
2)我們定義的接口 ** extends Repository,表示此接口納入spring管理,需按一定規(guī)則定義方法
如果我們自定義的接口沒有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)
查看全部 -
【spring data jpa】
1)依賴
org.springframework.data/spring-data-jpa
org.hibernate/hibernate-entitymanager
2)xml5個配置
a、配置數(shù)據(jù)源-dataSource
b、配置EntityManagerFactory class="org.springframework.ormljpa.LocalContainerEntityManagerFactoryBean"
c、配置事務管理器 class="org.springframework.orm.jpa.JpaTransactionManager"
d、配置支持注解的事務
e、配置spring data <jpa:repositories />
查看全部 -
Spring Data應用場景
查看全部 -
Spring Data概覽
查看全部 -
SpringData提供一致的,大家都熟悉的編程模型,為了簡化數(shù)據(jù)庫的訪問。
Spring Date JPA 目的:減少數(shù)據(jù)層的開發(fā)量?
Spring Date Mongo DB:基于分布式數(shù)據(jù)層的數(shù)據(jù)庫,在大數(shù)據(jù)層用的比較多?
Spring Date Redis:開源,由C語言編寫的,支持網(wǎng)絡、內(nèi)存,而且可以持久化的,提供非常多的語言支持?
Spring Date Solr:高性能 搜索功能 對查詢性能優(yōu)化
查看全部 -
JpaSpecificationExecutor接口使用詳解
查看全部 -
更新操作整合事務使用
查看全部 -
Query注解使用
查看全部 -
查詢方法定義規(guī)則和使用2
查看全部
舉報