首页>代码>springdata jpa 1.7.0.RELEASE各种查询方法总结demo大全,通过junit测试>/springdata_jpa_demo/src/main/java/com/zuidaima/springdata/repository/UserRepository.java
package com.zuidaima.springdata.repository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;

import com.zuidaima.springdata.entity.User;

/**
 * *@author javaniu 2013-06-04 22:27:22
 */

public interface UserRepository extends PagingAndSortingRepository<User, Long>,
		JpaSpecificationExecutor<User> {
	@Query(value = "select * from user where id in(:ids)", nativeQuery = true)
	List<User> findAllByIds(@Param("ids") List<Long> ids);

	@Query(value = "from User where name=?1")
	User findAllByName(String name);
}
最近下载更多
hait69396  LV8 2018年11月3日
13699231229  LV2 2018年4月25日
1119616605  LV18 2018年2月25日
BigBean  LV2 2017年9月19日
lingdu5h  LV3 2017年9月6日
der2030  LV17 2017年8月3日
jinbiao5  LV3 2017年6月29日
xiaoxinwt  LV10 2017年6月28日
vitalist  LV10 2017年6月19日
lisinian  LV6 2017年6月14日
最近浏览更多
fengshengtian  LV8 2022年2月26日
2021年11月11日
暂无贡献等级
253702090  LV3 2021年8月15日
徐万强  LV9 2021年6月2日
dieudonne  LV8 2021年3月2日
liudcc  LV5 2021年1月19日
Coincidance  LV8 2020年12月3日
gepanjiang 2020年10月23日
暂无贡献等级
As youi wish  LV1 2020年9月2日
猴哥猴哥  LV12 2020年5月18日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友