javax.persistence.criteria.Root.type()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(3.9k)|赞(0)|评价(0)|浏览(143)

本文整理了Java中javax.persistence.criteria.Root.type方法的一些代码示例,展示了Root.type的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Root.type方法的具体详情如下:
包路径:javax.persistence.criteria.Root
类名称:Root
方法名:type

Root.type介绍

暂无

代码示例

代码示例来源:origin: pl.edu.icm.cocos/cocos-services

public Predicate toPredicate(Root<T> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
    return cb.equal(root.type(), clazz);
  }
};

代码示例来源:origin: pl.edu.icm.cocos/cocos-services

public Predicate toPredicate(Root<T> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
    return cb.equal(root.type(), clazz);
  }
};

代码示例来源:origin: pl.edu.icm.cocos/cocos-services

protected final <T extends Comparable<T>> Predicate createTypePredicate(String clazz, Root<?> root, CriteriaBuilder cb) {
  if (clazz != null) {
    try {
      return cb.equal(root.type(), Class.forName(clazz));
    } catch (ClassNotFoundException e) {
      LOGGER.warn("Problem creating type filter", e);
    }
  }
  return null;
}

代码示例来源:origin: org.omnifaces/omnipersistence

@Override
public Expression<Class<? extends X>> type() {
  return getWrapped().type();
}

代码示例来源:origin: JoleneOL/market-manage

@Override
public Login asWechat(String openId) {
  return loginRepository.findOne((root, query, cb)
      -> cb.and(cb.equal(root.get("wechatUser").get("openId"), openId)
      , cb.notEqual(root.type(), Manager.class))
  );
}

代码示例来源:origin: pl.edu.icm.cocos/cocos-services

@Override
protected List<Selection<?>> getAggregations(Map<Expression<?>, String> paths, Root<CocosUserAuditEntryBase> root, CriteriaBuilder cb) {
  return Arrays.asList(
    cb.count(cb.selectCase().when(cb.equal(root.type(), CocosUserLoginAuditEntry.class), 1).otherwise(cb.nullLiteral(Long.class))).alias("login"),
    cb.count(cb.selectCase().when(cb.equal(root.type(), CocosUserHttpAuditEntry.class), 1).otherwise(cb.nullLiteral(Long.class))).alias("http"));
}

代码示例来源:origin: de.juplo.yourshouter.api/persistence-jpa

conjunction = builder.and(conjunction, builder.equal(root.type(), builder.literal(Place.class)));
 break;
case VENUE:
 conjunction = builder.and(conjunction, builder.equal(root.type(), builder.literal(Venue.class)));
 break;
case LOCATION:
 conjunction = builder.and(conjunction, builder.equal(root.type(), builder.literal(Location.class)));
 if (!categories.isEmpty())

代码示例来源:origin: JoleneOL/market-manage

@Override
  public Specification<Login> specification() {
    // root 是不可见,也不可以编辑的
    return (root, query, cb) -> {
      Predicate predicate = cb.and(cb.notEqual(root.get(Login_.loginName), "root")
          , cb.notEqual(root.type(), Manager.class)
      );
      if (!StringUtils.isEmpty(name)) {
        predicate = cb.and(
            predicate
            , cb.or(
                cb.like(root.get(Login_.loginName), "%" + name + "%")
                , cb.like(ReadService.nameForLogin(root, cb), "%" + name + "%")
                , cb.like(ReadService.mobileForLogin(root, cb), "%" + name + "%")
            )
        );
      }
      return predicate;
    };
  }
};

代码示例来源:origin: vladmihalcea/high-performance-java-persistence

builder.and(
  builder.equal(root.get("owner"), "Vlad"),
  builder.equal(root.type(), sublcass)

代码示例来源:origin: vladmihalcea/high-performance-java-persistence

builder.and(
  builder.equal(root.get("owner"), "Vlad"),
  builder.equal(root.type(), sublcass)

代码示例来源:origin: JoleneOL/market-manage

.where(
    cb.notEqual(root.type(), Manager.class)

代码示例来源:origin: pl.edu.icm.cocos/cocos-services

@Override
protected Expression<?> mapColumn(Root<CocosUserQueryBase> root, ReportRequestColumn column) {
  switch (column.getName()) {
  case "type":
    return root.type();
  case "domain":
    return createPath("user.domain.domainName", root, true);
  case "userRole":
    return createPath("user.authorities.authority", root, true);
  default:
    for (ReportColumnDefinition defCol : definition.getColumns()) {
      if (defCol.getName().equals(column.getName())) {
        return createPath(defCol.getDataProvider().getPath(), root, true);
      }
    }
    throw new CocosStatisticsConfigurationException(column.getName());
  }
}

相关文章