@Repository
public interface GatewayRouteRepository extends JpaRepository , JpaSpecificationExecutor {
@Query(nativeQuery = true, value ="SELECT r.id,r.route_order,p.`name` FROM gateway_route r,gateway_predicate p WHERE r.id=p.route_id ")
Page
2)无条件连接查询
@Query(nativeQuery = true, value = "SELECT r.id,r.route_order,p.`name` FROM gateway_route r,gateway_predicate p WHERE r.id=p.route_id ")
List getGatewayRouteAndGatewayPredicate();
测试:
List list = gatewayRouteRepository.getGatewayRouteAndGatewayPredicate();
log.info(JSON.toJSONString(list));
SQL:
Hibernate: SELECT r.id,r.route_order,p.`name` FROM gateway_route r,gateway_predicate p WHERE r.id=p.route_id
返回数据:
[["402881ee679c888301679c889b1f0000",0,"predicate"]]
2)条件连接查询
@Query(nativeQuery = true, value = "SELECT r.id,r.route_order,p.`name` FROM gateway_route r,gateway_predicate p WHERE r.id=p.route_id AND r.id=?1")
List getGatewayRouteAndGatewayPredicate(String id);
测试:
List list = gatewayRouteRepository.getGatewayRouteAndGatewayPredicate("402881ee679c888301679c889b1f0000");
log.info(JSON.toJSONString(list));
SQL:
Hibernate: SELECT r.id,r.route_order,p.`name` FROM gateway_route r,gateway_predicate p WHERE r.id=p.route_id AND r.id=?
返回数据:
[["402881ee679c888301679c889b1f0000",0,"predicate"]]
@Query("select r,p from GatewayRoute r join r.predicates p ")
List getGatewayRouteAndGatewayPredicate();
测试:
List list = gatewayRouteRepository.getGatewayRouteAndGatewayPredicate();
log.info(JSON.toJSONString(list));
SQL:
select gatewayrou0_.id as id1_2_0_, predicates1_.id as id1_0_1_, gatewayrou0_.route_order as route_or2_2_0_, gatewayrou0_.uri as uri3_2_0_, predicates1_.name as name2_0_1_ from gateway_route gatewayrou0_ inner join gateway_predicate predicates1_ on gatewayrou0_.id=predicates1_.route_id
返回数据:
[[{"id":"402881ee679c888301679c889b1f0000","orders":0,"predicates":[{"id":2,"name":"predicate"}],"uri":"http://www.baidu.com"},{"$ref":"$[0].null.predicates[0]"}]]
原文地址:http://www.cnblogs.com/Kavlez/p/4268601.html Enumeration
于Java 1.5增加的enum type...enum type是由一组固定的常量组成的类型,比如四个季节、扑克花色。在出现enum type之前,通常用一组int常量表示枚举类型。比如这样:
public static final int APPLE_FUJI = 0
第二章 Getting Started
1.Hive最大的局限性是什么?一是不支持行级别的增删改(insert, delete, update)二是查询性能非常差(基于Hadoop MapReduce),不适合延迟小的交互式任务三是不支持事务2. Hive MetaStore是干什么的?Hive persists table schemas and other system metadata.
/*
* 0.use a TwoWayLinkedList to store the path.when the node can't be path,you should/can delete it.
* 1.curSum==exceptedSum:if the lastNode is TreeNode,printPath();delete the node otherwise
//js获取项目根路径,如: http://localhost:8083/uimcardprj
function getRootPath(){
//获取当前网址,如: http://localhost:8083/uimcardprj/share/meun.jsp
var curWwwPath=window.document.locati
在Linux下面部 署应用的时候,有时候会遇上Socket/File: Can’t open so many files的问题;这个值也会影响服务器的最大并发数,其实Linux是有文件句柄限制的,而且Linux默认不是很高,一般都是1024,生产服务器用 其实很容易就达到这个数量。下面说的是,如何通过正解配置来改正这个系统默认值。因为这个问题是我配置Nginx+php5时遇到了,所以我将这篇归纳进