范文健康探索娱乐情感热点
投稿投诉
热点动态
科技财经
情感日志
励志美文
娱乐时尚
游戏搞笑
探索旅游
历史星座
健康养生
美丽育儿
范文作文
教案论文
国学影视

SpringDataJPA系列06自定义操作(JPQLSQL)

  6、自定义操作(JPQL / SQL)
  在我们经过了上面的学习,我们会发现一个问题:那就是我们所支持的就是一些简单的增删查改等等的操作,对于复杂的一些操作并不支持,所以我们也需要进行一些自定义,可以通过SQL或者 JPQL进行自定义操作!
  自定义操作: 1、JPQL(原生SQL)@Query 查询如果返回单个实体,就使用pojo类进行接收即可,如果是多个就使用list进行接收! 参数设置方式 索引:?数字 具名::参数名 结合@Param注解指定参数名称 | 增删改: 要加上事务的支持: 如果是插入方法:一定只能在hibernate下才支持(Insert into … select) @Transactional    // 开启事务!通常会放在业务逻辑层上去声明!    @Modifying    // 通知springdatajpa 是增删改的操作!    复制代码
  测试代码如下: 创建repository/CustomerRepository  package com.yykk.repositories;    import com.yykk.pojo.Customer;  import org.springframework.data.jpa.repository.Modifying;  import org.springframework.data.jpa.repository.Query;  import org.springframework.data.repository.PagingAndSortingRepository;  import org.springframework.data.repository.query.Param;  import org.springframework.transaction.annotation.Transactional;    import java.util.List;    public interface CustomerRepositories extends PagingAndSortingRepository{        // 使用JPQL实现增删改查        // 查询      //@Query("from Customer where custName=?1")      @Query(value = "from Customer where custName=:custName")      List findCustomerByCustName(@Param("custName") String custName);        /**       *  更新操作!       *  在这里如果没有事务的支持,那么我们会报错!需要定义在业务逻辑层里面!       *  @Modifying  // 通知springdatajpa 是增删改的操作!       */      @Query("update Customer c set c.custName=:custName where c.id=:id")      @Transactional // 开启事务!      @Modifying  // 通知springdatajpa 是增删改的操作!      int updateCustomerById(@Param("custName") String custName,@Param("id") Long id);        // 删除      @Query("delete from Customer c  where c.id=?1")      @Transactional // 开启事务!      @Modifying  // 通知springdatajpa 是增删改的操作!      String deleteCustomer(Long id);        // 新增 JPQL 默认是不支持的,但是这里是使用的伪插入,底层是hibernate!      // 通知springdatajpa 是增删改的操作!      //@Transactional // 开启事务!      //@Modifying      //@Query(value = "insert into Customer(custName) select cust_name from Customer where id=?1") //这里推荐使用其他方法insert方法不推荐使用!如果要使用可以使用原生的!这里没有values报错!可以尝试一下拼接!      //int insertCustomerBySelect(Long id);        // 原生SQL查询      // 在这个查询中写成custName之后就报错!      @Query(value = "select * FROM tb_Customer where cust_name= ? "              ,nativeQuery = true)      List findCustomerByCustNameBySql(@Param("custName") String custName);    } 复制代码测试! import com.yykk.config.SpringDataJPAConfig;  import com.yykk.pojo.Customer;  import com.yykk.repositories.CustomerRepositories;  import org.junit.Test;  import org.junit.runner.RunWith;  import org.springframework.beans.factory.annotation.Autowired;  import org.springframework.test.context.ContextConfiguration;  import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;    import java.util.List;    @ContextConfiguration(classes = SpringDataJPAConfig.class)  @RunWith(SpringJUnit4ClassRunner.class)  public class JPQLTest {        @Autowired      CustomerRepositories repositories;        /**       * 查询测试!       * 因为可能会遇到返回的结果是多个相同的,就使用list接收!       */      @Test      public void testQuery() {          List customer = repositories.findCustomerByCustName("yykk");          System.out.println(customer);      }        /**       *  更新操作!       *  在这里如果没有事务的支持,那么我们会报错!需要定义在业务逻辑层里面!       */      @Test      public void testUpdate() {          int result = repositories.updateCustomerById("apple", 3L);          System.out.println(result);      }        @Test      public void testDelete() {          String result = repositories.deleteCustomer( 9L);          System.out.println(result);      }        //@Test      //public void testInsert() {      //    int result = repositories.insertCustomerBySelect(1L);      //    System.out.println(result);      //}        @Test      public void testQuery_sql() {            List list = repositories.findCustomerByCustNameBySql("yykk");          System.out.println(list);      }  } 复制代码2、规定方法名只支持查询方法主题关键字(前缀)只有查询和删除!决定当前方法作用!查询主题关键字
  关键字
  描述
  find…By  、`read…By  、get…By  、query..By  、search…By  、stream…By
  通过查询方法通常返回存储库类型、Collection  或Streamable  子类型或结果包装器,例如:Page  、GeoResults  或任何其他特定于商店的结果包装器。可用于 findBy…  ,findMyDomainTypeBy…
  exists…By
  存在投影,通常返回  boolean  结果
  count…By
  计数投影返回数字结果。
  delete…By、remove…By
  删除查询方法返回无结果( void  )或删除计数。
  …First…  ,…Top…
  将查询结果限制为第一个  结果。此关键字可以出现在主题的find  (和其他关键字)和之间的任何位置by  。
  …Distinct…
  使用不同的查询仅返回唯一的结果。查询特定与商店的文档是否支持该功能。此关键字可以出现在主题的  find  (和其他关键字)和之间的任意位置 by  。支持的查询方法谓词关键字和修饰符决定查询条件
  Keyword
  Sample
  JPQL snippet
  And
  findByNameAndPwd
  where name= ? and pwd =?
  Or
  findByNameOrSex
  where name= ? or sex=?
  Is,Equals
  findById,findByIdEquals
  where id= ?
  Between
  findByIdBetween
  where id between ? and ?
  LessThan
  findByIdLessThan
  where id < ?
  LessThanEquals
  findByIdLessThanEquals
  where id <= ?
  GreaterThan
  findByIdGreaterThan
  where id > ?
  GreaterThanEquals
  findByIdGreaterThanEquals
  where id > = ?
  After
  findByIdAfter
  where id > ?
  Before
  findByIdBefore
  where id < ?
  IsNull
  findByNameIsNull
  where name is null
  isNotNull,NotNull
  findByNameNotNull
  where name is not null
  Like
  findByNameLike
  where name like ?
  NotLike
  findByNameNotLike
  where name not like ?
  StartingWith
  findByNameStartingWith
  where name like ‘?%’
  EndingWith
  findByNameEndingWith
  where name like ‘%?’
  Containing
  findByNameContaining
  where name like ‘%?%’
  OrderBy
  findByIdOrderByXDesc
  where id=? order by x desc
  Not
  findByNameNot
  where name <> ?
  In
  findByIdIn(Collection<?> c)
  where id in (?)
  NotIn
  findByIdNotIn(Collection<?> c)
  where id not in (?)
  TRUE
  findByAaaTue
  where aaa = true
  FALSE
  findByAaaFalse
  where aaa = false
  IgnoreCase
  findByNameIgnoreCase
  where UPPER(name)=UPPER(?)
  top
  findTop10
  top 10/where ROWNUM <=10
  Distinct
  findDistinctByLastnameAndFirstname
  select distinct … where x.lastname = ?1 and x.firstname = ?2
  1、repository/CustomerMethodNameRepositories package com.yykk.repositories;    import com.yykk.pojo.Customer;  import org.springframework.data.jpa.repository.Modifying;  import org.springframework.data.repository.PagingAndSortingRepository;  import org.springframework.transaction.annotation.Transactional;    import java.util.List;    public interface CustomerMethodNameRepositories extends PagingAndSortingRepository{        List findByCustName(String custName);        boolean existsByCustName(String custName);        @Transactional      @Modifying      int deleteByid(Long id);        List findByCustNameLike(String custName);    } 复制代码
  2、测试! import com.yykk.config.SpringDataJPAConfig;  import com.yykk.pojo.Customer;  import com.yykk.repositories.CustomerMethodNameRepositories;  import org.junit.Test;  import org.junit.runner.RunWith;  import org.springframework.beans.factory.annotation.Autowired;  import org.springframework.test.context.ContextConfiguration;  import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;    import java.util.List;    @ContextConfiguration(classes = SpringDataJPAConfig.class)  @RunWith(SpringJUnit4ClassRunner.class)  public class MethodName {        @Autowired      CustomerMethodNameRepositories repository;        @Test      public void list(){          List list = repository.findByCustName("yykk");          System.out.println(list);      }        @Test      public void exists(){          boolean exists = repository.existsByCustName("yykk");          System.out.println(exists);      }        @Test      public void delete(){          int del = repository.deleteByid(12L);          System.out.println(del);      }        @Test      public void like(){          List list = repository.findByCustNameLike("y%");          System.out.println(list);      }  } 复制代码
  这里的都是静态的固定查询,对于动态的查询要根据以下的这几种方法!3、通过Query by Example只支持查询不支持嵌套或分组的属性约束,如firstname = ?0 or(firstname = ? 1 and lastname = ? 2)只支持字符串 start/contains/ends/regex 匹配和其他属性类型的精确匹配。
  实现:
  1、将Repository继承QueryByExampleExecutor package com.yykk.repositories;    import com.yykk.pojo.Customer;  import org.springframework.data.repository.PagingAndSortingRepository;  import org.springframework.data.repository.query.QueryByExampleExecutor;    public interface CustomerQBERepositories extends PagingAndSortingRepository          , QueryByExampleExecutor {    } 复制代码
  2、测试代码! import com.yykk.config.SpringDataJPAConfig;  import com.yykk.pojo.Customer;  import com.yykk.repositories.CustomerQBERepositories;  import org.junit.Test;  import org.junit.runner.RunWith;  import org.springframework.beans.factory.annotation.Autowired;  import org.springframework.data.domain.Example;  import org.springframework.data.domain.ExampleMatcher;  import org.springframework.test.context.ContextConfiguration;  import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;    @ContextConfiguration(classes = SpringDataJPAConfig.class)  @RunWith(SpringJUnit4ClassRunner.class)  public class QueryByExampleExecutor {        @Autowired      CustomerQBERepositories repository;        /**       * 简单实例:客户名称,客户地址动态查询!       */      @Test      public void list() {          Customer customer = new Customer();          customer.setCustName("yykk");          customer.setCustAddress("上海");            // 通过 Example构造查询条件!          Example example = Example.of(customer);            Iterable all = repository.findAll(example);          System.out.println(all);      }        /**       * 通过匹配器,进行条件的限制!       * 简单实例:客户名称,客户地址动态查询!       */      @Test      public void test() {          Customer customer = new Customer();          customer.setCustName("kk");          customer.setCustAddress("HAI");            // 通过匹配器对条件行为进行设置!          ExampleMatcher matcher = ExampleMatcher.matching()                  .withIgnorePaths("custName")  // 设置忽略的属性!                  //.withIgnoreCase("cust_address")   // 设置忽略大小写,默认不写就是全部属性的设置!                  //.withStringMatcher(ExampleMatcher.StringMatcher.ENDING); // 对字符串进行结尾匹配                  .withMatcher("cust_address",m -> m.endsWith().ignoreCase(true));  // 针对单个条件进行设置,会使withIgnoreCase失效!                  //.withMatcher("custAddress", ExampleMatcher.GenericPropertyMatchers.endsWith());          // 通过 Example构造查询条件!          Example example = Example.of(customer,matcher);            Iterable list = repository.findAll(example);          System.out.println(list);      }    } 复制代码4、通过Specifications
  之前使用Query by Example只能针对字符串进行条件设置,那如果希望对所有类型支持,可以使用Specifcations
  实现
  1、继承接口 package com.yykk.repositories;    import com.yykk.pojo.Customer;  import org.springframework.data.jpa.repository.JpaSpecificationExecutor;  import org.springframework.data.repository.PagingAndSortingRepository;    public interface CustomerSpecificationsRepositories extends PagingAndSortingRepository          ,JpaSpecificationExecutor {        } 复制代码root:查询哪个表(关联查询)= fromCriteriaQuery:查询哪些字段,排序是什么 = 组合(order by 、where)CriteriaBuilder:条件之间是什么关系,如何生成一个查询条件,每一个查询条件是什么类型(> between in …)= wherePredicate(Expression):每一条查询条件的详细描述
  2、测试! import com.yykk.config.SpringDataJPAConfig;  import com.yykk.pojo.Customer;  import com.yykk.repositories.CustomerSpecificationsRepositories;  import org.junit.Test;  import org.junit.runner.RunWith;  import org.springframework.beans.factory.annotation.Autowired;  import org.springframework.data.jpa.domain.Specification;  import org.springframework.test.context.ContextConfiguration;  import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;  import org.springframework.util.StringUtils;    import javax.persistence.EntityManager;  import javax.persistence.criteria.*;  import java.util.ArrayList;  import java.util.List;    @ContextConfiguration(classes = SpringDataJPAConfig.class)  @RunWith(SpringJUnit4ClassRunner.class)  public class SpecificationsTest {        @Autowired      CustomerSpecificationsRepositories repository;        @Autowired      EntityManager entityManager;        @Test      public void test_All(){          List customer = repository.findAll(new Specification() {              @Override              public Predicate toPredicate(Root root, CriteriaQuery<?> query, CriteriaBuilder criteriaBuilder) {                    // root from Customer ,获取列                  // CriteriaBuilder 设置各种条件 (< > in ...)                  // query 组合(order by ,where )                    return null;              }          });      }        /**       * 查询客户范围(in)       * id > 大于       * 地址:精确       */      @Test      public void test_Coll(){          List customer = repository.findAll(new Specification() {              @Override              public Predicate toPredicate(Root root, CriteriaQuery<?> query, CriteriaBuilder criteriaBuilder) {                    // root from Customer ,获取列                  // CriteriaBuilder 设置各种条件 (< > in ...)                  // query 组合(order by ,where )                    Path id = root.get("id");                  Path custName = root.get("custName");                  Path custAddress = root.get("custAddress");                    // 参数1:为哪个字段设置条件    参数2:值                  Predicate address = criteriaBuilder.equal(custAddress, "SHANGHAI");                  Predicate ids = criteriaBuilder.greaterThan(id, 0L);                  CriteriaBuilder.In in = criteriaBuilder.in(custName);                  in.value("yykk").value("张三");                    Predicate predicate = criteriaBuilder.and(address, ids,in);                    return predicate;              }          });          System.out.println(customer);      }        /**       * 查询客户范围(in)       * id > 大于       * 地址:精确       * 将这里的值设置为动态的!       */      @Test      public void test_dynamic(){            Customer params = new Customer();          params.setId(0L);          params.setCustAddress("SHANGHAI");          params.setCustName("yykk,apple");            List customer = repository.findAll(new Specification() {              @Override              public Predicate toPredicate(Root root, CriteriaQuery<?> query, CriteriaBuilder criteriaBuilder) {                    // root from Customer ,获取列                  // CriteriaBuilder 设置各种条件 (< > in ...)                  // query 组合(order by ,where )                    Path id = root.get("id");                  Path custName = root.get("custName");                  Path custAddress = root.get("custAddress");                    // 参数1:为哪个字段设置条件    参数2:值                  List list = new ArrayList<>();                  if (StringUtils.isEmpty(params.getCustAddress())) {                      list.add(criteriaBuilder.equal(custAddress, "SHANGHAI"));                  }                  if (params.getId() > -1) {                      list.add(criteriaBuilder.greaterThan(id, 0L));                  }                  if (StringUtils.isEmpty(params.getCustName())) {                      CriteriaBuilder.In in = criteriaBuilder.in(custName);                      in.value("yykk").value("张三");                      list.add(in);                  }                    Predicate predicate = criteriaBuilder.and(list.toArray(new Predicate[list.size()]));                    return predicate;              }          });          System.out.println(customer);      }        /**       * 查询客户范围(in)       * id > 大于       * 地址:精确       * 将这里的值设置为动态的!       */      @Test      public void test_dynamicx(){            CriteriaBuilder builder = entityManager.getCriteriaBuilder();          CriteriaQuery query = builder.createQuery();          Root root = query.from(Customer.class);            Customer params = new Customer();          params.setId(0L);          params.setCustAddress("SHANGHAI");          params.setCustName("yykk,apple");            List customer = repository.findAll(new Specification() {              @Override              public Predicate toPredicate(Root root, CriteriaQuery<?> query, CriteriaBuilder criteriaBuilder) {                    // root from Customer ,获取列                  // CriteriaBuilder 设置各种条件 (< > in ...)                  // query 组合(order by ,where )                    // 1、通过root拿到需要设置条件的字段                  Path id = root.get("id");                  Path custName = root.get("custName");                  Path custAddress = root.get("custAddress");                    // 2、通过CriteriaBuilder设置不同的类型条件                  List list = new ArrayList<>();                  if (StringUtils.isEmpty(params.getCustAddress())) {                      // 参数1:为哪个字段设置条件    参数2:值                      list.add(criteriaBuilder.equal(custAddress, "SHANGHAI"));                  }                  if (params.getId() > -1) {                      list.add(criteriaBuilder.greaterThan(id, 0L));                  }                  if (StringUtils.isEmpty(params.getCustName())) {                      CriteriaBuilder.In in = criteriaBuilder.in(custName);                      in.value("yykk").value("张三");                      list.add(in);                  }                    // 3、组合条件!                  Predicate predicate = criteriaBuilder.and(list.toArray(new Predicate[list.size()]));                    Order desc = criteriaBuilder.desc(id);                  return query.where(predicate).orderBy(desc).getRestriction();              }          });          System.out.println(customer);      }    } 复制代码
  限制:不能分组、聚合函数,需要自己通过entityManager! 5、通过Querydsl
  官网:querydsl.com/
  Github:github.com/querydsl/qu…
  中文文档:github.com/wjw465150/Q…
  Querydsl 是基于ORM框架或SQL平台上的一个通用查询框架。借助于Querydsl可以在任何支持的ORM框架或者SQL平台上以通用API方式构建查询!
  JPA是QueryDSL的主要集成技术,是JPQL和Criteria查询的替代方法。目前QueryDSL支持的平台包括JPA、JDO、SQL、MongoDB等等!
  QueryDSL扩展让我们以链式方式编写查询方法。该扩展需要一个接口QueryDslPredicateExecutor,它定义了很多查询方法。
  1、接口继承了该接口,就可以使用提供的各种方法了! package com.yykk.repositories;    import com.yykk.pojo.Customer;  import org.springframework.data.querydsl.QuerydslPredicateExecutor;  import org.springframework.data.repository.PagingAndSortingRepository;    public interface CustomerQueryDSLRepositories extends PagingAndSortingRepository          , QuerydslPredicateExecutor {    } 复制代码
  2、导入依赖!     com.querydsl    querydsl-apt    ${querydsl.version}    provided          com.querydsl    querydsl-jpa    ${querydsl.version}          org.slf4j    slf4j-log4j12    1.6.1   复制代码
  3、配置Maven APT插件!                       com.mysema.maven        apt-maven-plugin        1.1.3                                            process                                      target/generated-sources/java              com.querydsl.apt.jpa.JPAAnnotationProcessor                                               复制代码
  JPAAnnotationProcessor   查找使用 javax.persistence.Entity   注解的实体类并为它们生成查询类。
  如果您在实体类中使用 Hibernate 注解,则应改用 APT 处理器 com.querydsl.apt.hibernate.HibernateAnnotationProcessor  。
  运行maven clean install  ,您将得到生成的查询类到 target/generated-sources/java  目录下。
  如果您使用 Eclipse,请运行 mvn eclipse:eclipse   来更新您的 Eclipse 项目以包含 target/generated-sources/java   作为源文件夹。
  简单理解:打开IDEA的项目工程,将我们生成的Q类设置为Sources资源类!
  4、测试! import com.querydsl.core.Tuple;  import com.querydsl.core.types.dsl.BooleanExpression;  import com.querydsl.jpa.impl.JPAQuery;  import com.querydsl.jpa.impl.JPAQueryFactory;  import com.yykk.config.SpringDataJPAConfig;  import com.yykk.pojo.Customer;  import com.yykk.pojo.QCustomer;  import com.yykk.repositories.CustomerQueryDSLRepositories;  import org.junit.Test;  import org.junit.runner.RunWith;  import org.springframework.beans.factory.annotation.Autowired;  import org.springframework.test.context.ContextConfiguration;  import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;  import org.springframework.util.StringUtils;    import javax.persistence.EntityManager;  import javax.persistence.PersistenceContext;  import java.util.List;    @ContextConfiguration(classes = SpringDataJPAConfig.class)  @RunWith(SpringJUnit4ClassRunner.class)  public class QueryDSLTest {        @Autowired      CustomerQueryDSLRepositories repository;        // 解决线程安全问题,类似于Autowired!@Bean默认是单例的,JPA就有线程安全问题!      @PersistenceContext      EntityManager entityManager;          @Test      public void test_All(){          QCustomer customer = QCustomer.customer;            // 通过id查找          BooleanExpression eq = customer.id.eq(1L);          System.out.println(repository.findOne(eq));      }        /**       * 查询客户范围(in)       * id > 大于       * 地址:精确       */      @Test      public void test_demo(){          QCustomer customer = QCustomer.customer;            // 通过id查找          BooleanExpression and = customer.custName.in("yykk","apple")                          .and(customer.id.gt(0L))                          .and(customer.custAddress.eq("SHANGHAI"));          System.out.println(repository.findOne(and));      }          /**       * 查询客户范围(in)       * id > 大于       * 地址:精确       * 测试动态的!       */      @Test      public void test(){            Customer params = new Customer();          params.setId(0L);          params.setCustAddress("SHANGHAI");          params.setCustName("yykk");            QCustomer customer = QCustomer.customer;            // 初始条件 类似于1=1,永远都成立!          BooleanExpression expression = customer.isNotNull().or(customer.isNull());            expression = params.getId() > -1 ?                  expression.and(customer.id.gt(params.getId())) : expression;            expression = !StringUtils.isEmpty(params.getCustName()) ?                  expression.and(customer.custName.in(params.getCustName().split(","))) : expression;            expression = !StringUtils.isEmpty(params.getCustAddress()) ?                  expression.and(customer.custAddress.in(params.getCustAddress())) : expression;            System.out.println(repository.findAll(expression));      }        /**       * 自定义列查询、分组       * 需要使用原生态的方式!(Specification)       */      @Test      public void test_customize(){          JPAQueryFactory factory = new JPAQueryFactory(entityManager);            QCustomer customer = QCustomer.customer;            // select id,custName from ...          // 构建基于QueryDsl的查询          JPAQuery tupleJPAQuery = factory.select(customer.id, customer.custName)                  .from(customer)                  .where(customer.id.eq(1L))                  .orderBy(customer.id.desc());            // 执行查询          List fetch = tupleJPAQuery.fetch();            // 处理返回数据          for (Tuple tuple : fetch) {              System.out.println(tuple.get(customer.id));              System.out.println(tuple.get(customer.custName));          }      }        /**       * 自定义列查询、分组       * 需要使用原生态的方式!(Specification)       * 通过Repository进行查询,列、表都是固定的!       */      @Test      public void test_customize_list(){          JPAQueryFactory factory = new JPAQueryFactory(entityManager);            QCustomer customer = QCustomer.customer;            // select id,custName from ...          // 构建基于QueryDsl的查询          JPAQuery longJPAQuery = factory.select(customer.id.sum())                  .from(customer)                  //.where(customer.id.eq(1L))                  .orderBy(customer.id.desc());            // 执行查询          List fetch = longJPAQuery.fetch();            // 处理返回数据          for (Long tuple : fetch) {              System.out.println(tuple);          }      }  }
10部适合46岁宝宝看的启蒙动画片,陪孩子过春节假期上次呢,给各位家长朋友推荐了24岁小朋友适合看的动画片,今天呢,我就给各位家长朋友推荐几部46岁宝宝适合看的动画片。46岁这是个充满了矛盾的年纪,自我意识蓬勃生长,能力又困顿于发育家里有学生,建议妈妈多做这7种早餐,营养丰富,一周不重样早餐是一日之中最为重要的一餐,经过了长达8个小时的睡眠,身体正是吸收营养的阶段,所以早餐不能将就,尤其是家里有学生的家长,早餐更不应该含糊,今天就给宝妈们分享6种早餐,简单好吃又有我在新西兰经历的无差别人为车祸死里逃生!(一)读万卷书,行万里路。哪个更重要?我的亲身体验告诉我。行万里路可能远远比读万卷书更有可能让你深切的体悟生命的真相和世界的真相。我曾经学医,也在美国硅谷做过脑科学科研,一直对生死问题十中国发展密码五问之五丨2022年如何进一步推动乡村振兴?3月11日,游客在贵州省贵定县盘江镇金海雪山景区观赏油菜花。新华社记者杨文斌摄2022年是巩固拓展脱贫攻坚成果同乡村振兴有效衔接的关键一年。2022年的政府工作报告提出,大力抓好农这些免票的美景,徒步可赏!为什么说春天适合徒步?因为一抬眼就会被美到!田间的风山间的花倒映着天空的水面广仔整理了几个徒步踏青好去处登山古道赏湖趁着和煦暖阳一起去打卡吧!广东峡天下广东峡天下地处阳山喀斯特大峡长期便秘拖着不理?这3个危害不是开玩笑,缓解做好这3点有的人排便轻松,感觉想要排便第一时间上厕所,不用两三分钟就能完成。而有的人备受便秘困扰,连续几天没有排便,上厕所时费很多劲依然无法排便顺畅,要引起重视。因为保持健康,肠道动力充足,春季失眠睡不好?别着急,这5招帮你沾床就睡不待春来呼我困,四时何日不堪眠?春暖花开是最适合睡觉的时节,但是很多人却深受失眠的困扰。有调查显示,60岁以上老人睡眠障碍的患病率在3040之间。广州市第一人民医院精神心理科副主任少年时读书和玩耍之间,春分来回好几度,无奈心智未熟透,不知不觉中到了青年。未到19岁,已经混社会,那段少年时代的气息仿如昨日,一去不回。直到步入中年的春分,对未来老年的春分充满期待儿童游乐设备种类繁多,有灵魂游乐项目,仅此一家不容错过要管理好儿童乐园,有灵魂游乐项目是必不可少的。如今,儿童游乐设备种类繁多,对于娱乐业的新进入者来说,选择一款好的设备是一件困难的事情。那么我们如何选择最适合儿童的游乐设备呢?泛娱文马云承诺每年在沙漠种1亿棵树,5年过去了,如今怎么样了?声明原创不易,禁止搬运,违者必究!支付宝是我们常用的第三方软件,有使用过支付宝也发现,这不单单是一款支付软件,里面还有很多的板块。其中还有一个蚂蚁森林,也有不少的用户都有参与,用户在撒哈拉沙漠无人区,被当地警察护送是什么样的体验2018年3月底,我和几个旅行的朋友要从阿尔及利亚首都阿尔及利亚乘坐飞机到南部的沙漠腹地贾奈特,开始十天的撒哈拉沙漠旅行。这个飞往贾奈特的飞机是小型飞机,还带螺旋桨的,在很多人眼里
索尼公布PS港服2022年1月会免阵容三款游戏免费领索尼公布了PS港服2022年1月会免阵容,与欧美服一致,共赠送了三款游戏。会免详情PS4女神异闻录5乱战魅影攻手女神异闻录5乱战魅影攻手是Atlus与光荣特库摩旗下OmegaFor原神大型辟谣现场,八重神子游戏实景照,确定为P图在原神这款游戏当中,我们迎来了申鹤和云堇这两位角色,伴随着2。4版本即将开启,今天11点时会预下载开放,到了晚上1800,发布2。5版本角色新立绘,到那时我们就可以知道2。5版本角SpringBoot整合ElasticSearch实现增删改查基本示例SpringBoot整合ElasticSearch实现增删改查基本示例ElasticSearch被命名为大数据搜索引擎,在文件检索数据存储方面具有天然的优势。而SpringBoot中汽研发布特斯拉蔚来比亚迪小鹏宝马等冬季续航测试结果IT之家12月29日消息,中国汽车技术研究中心现发布了一份评测结果,对于一些热门电动汽车在冬季续航能力进行了测试,包括特斯拉Model3蔚来EC6比亚迪汉EV小鹏P7宝马iX3哪吒蔚来,会是下一个OFO么?最近,蔚来老总李斌一句我不明白现在为什么还有人要买燃油车。的言论被网友们批上热搜。这句话已经有很多文章批判分析过,在此我也就不做展开。不过,就现在蔚来的发展模式,却总让我有一种站在向特斯拉学习如何把70多个零件减少为1个零件2021回顾No。4年底了,选出一年中我认为最有价值的5篇文章。这是2021年阅读量最高和评论最多的文章之一。不过,很多评论都是在质疑特斯拉创新的成功性。而我关注的是特斯拉创新背后的原理和思维方式DF李霄鹏迎坏消息!国足核心球员直言,一年半不能踢球了李霄鹏迎坏消息!国足核心球员直言,一年半不能踢球了亲情提示亲爱的读者,如何能每天能读到这样的体育资讯呢?点击右上角的关注按钮即可,您的关注将是我创作的最大动力!北京时间2021年1拒绝几百万年薪去创业,他年仅42岁,带出的企业市值达1。34万亿如果有一份年薪几百万的工作摆在眼前,你是否接受邀约呢?曾经的他就坚定地拒绝了万达抛来的橄榄枝。原因不是他出自富裕家庭,本来就有亿万资产可继承,而是比起这些现有的财富,他更加渴望成功新式飞碟可以在月球自由飞翔麻省理工学院分享说,他的一些工程师正在研究一个新概念有朝一日可以探索月球小行星和其他无空气表面的飞碟。根据麻省理工学院新闻办公室的报道,飞碟将利用月球的自然电荷悬浮在地面上。对该主光荣特库摩将在2022年推出众多新作来展现实力光荣特库摩在2021年推出了很多游戏新作,但玩家对于这些新作的评价明显不如预期中的满意。近日光荣特库摩的游戏制作人们在接受外媒4Gamer的采访时,TeamNinja的总经理早矢仕国足5大花臂都有欧洲血统,有人身价1亿人民币今混迹中甲体育总局有关国足各年龄段队伍纹身禁令的消息,目前仍在发酵中,令人有些尴尬的是,人才土壤本就贫瘠的中国足球,身上背着纹身的球员却不在少数,若真是一刀切的话,恐怕国足的概念都将不复存在