コード例 #1
0
  protected HypervisorCapabilitiesDaoImpl() {
    HypervisorTypeSearch = createSearchBuilder();
    HypervisorTypeSearch.and(
        "hypervisorType", HypervisorTypeSearch.entity().getHypervisorType(), SearchCriteria.Op.EQ);
    HypervisorTypeSearch.done();

    HypervisorTypeAndVersionSearch = createSearchBuilder();
    HypervisorTypeAndVersionSearch.and(
        "hypervisorType",
        HypervisorTypeAndVersionSearch.entity().getHypervisorType(),
        SearchCriteria.Op.EQ);
    HypervisorTypeAndVersionSearch.and(
        "hypervisorVersion",
        HypervisorTypeAndVersionSearch.entity().getHypervisorVersion(),
        SearchCriteria.Op.EQ);
    HypervisorTypeAndVersionSearch.done();

    MaxGuestLimitByHypervisorSearch = createSearchBuilder(Long.class);
    MaxGuestLimitByHypervisorSearch.selectField(
        MaxGuestLimitByHypervisorSearch.entity().getMaxGuestsLimit());
    MaxGuestLimitByHypervisorSearch.and(
        "hypervisorType",
        MaxGuestLimitByHypervisorSearch.entity().getHypervisorType(),
        SearchCriteria.Op.EQ);
    MaxGuestLimitByHypervisorSearch.and(
        "hypervisorVersion",
        MaxGuestLimitByHypervisorSearch.entity().getHypervisorVersion(),
        SearchCriteria.Op.EQ);
    MaxGuestLimitByHypervisorSearch.done();
  }
コード例 #2
0
  protected StorageNetworkIpAddressDaoImpl() {
    countInUserIp = createSearchBuilder(Long.class);
    countInUserIp.select(null, Func.COUNT, null);
    countInUserIp.and("rangeId", countInUserIp.entity().getRangeId(), Op.EQ);
    countInUserIp.and("taken", countInUserIp.entity().getTakenAt(), Op.NNULL);
    countInUserIp.done();

    listInUseIp = createSearchBuilder(String.class);
    listInUseIp.selectField(listInUseIp.entity().getIpAddress());
    listInUseIp.and("rangeId", listInUseIp.entity().getRangeId(), Op.EQ);
    listInUseIp.and("taken", listInUseIp.entity().getTakenAt(), Op.NNULL);
    listInUseIp.done();

    untakenIp = createSearchBuilder();
    untakenIp.and("rangeId", untakenIp.entity().getRangeId(), Op.EQ);
    untakenIp.and("taken", untakenIp.entity().getTakenAt(), Op.NULL);
    untakenIp.done();

    ipSearch = createSearchBuilder();
    ipSearch.and("ipAddress", ipSearch.entity().getIpAddress(), Op.EQ);
    ipSearch.done();
  }