コード例 #1
0
 private Option<Address> findAddressOfOwnerByPhoneNumber(String number, Integer ownerId) {
   if (checkOwner) {
     return addressDAO.findAddressOfOwnerByCategoryAndPhoneNumber(ownerId, category, number);
   } else {
     return addressDAO.findAddressByCategoryAndPhoneNumber(category, number);
   }
 }
コード例 #2
0
 @Override
 public Option<Address> findAddressOfOwnerByPhoneNumber(PhoneNumber number, Integer ownerId) {
   if (checkOwner) {
     return addressDAO.findAddressOfOwnerByCategoryAndPhoneNumber(ownerId, category, number);
   } else {
     return addressDAO.findAddressByCategoryAndPhoneNumber(category, number);
   }
 }
コード例 #3
0
 @Override
 public List<Address> findAddressOfOwnerByNameStartsWith(String name, Integer ownerId) {
   if (checkOwner) {
     return addressDAO.findAddressesOfOwnerByCategoryAndLastNameOrCompanyStartsWith(
         ownerId, category, name);
   } else {
     return addressDAO.findAddressesByCategoryAndNameOrCompanyStartsWith(category, name);
   }
 }
コード例 #4
0
 @Override
 public Option<Address> findAddressByOwnerAndContactNumber(Integer ownerId, String contactNumber) {
   if (ownerId != null && isGlobalStore()) {
     return null;
   }
   return addressDAO.findAddressByOwnerAndCategoryAndContactNumber(
       ownerId, category, contactNumber);
 }
コード例 #5
0
  @Override
  public List<PhoneNumber> findPhoneNumbersOfOwnerEndingWith(String number, Integer ownerId) {
    if (checkOwner) {
      return addressDAO.findPhoneNumbersOfOwnerEndingWith(ownerId, number);
    }

    return new LinkedList<PhoneNumber>();
  }
コード例 #6
0
  @Override
  public List<PhoneNumber> findPhoneNumbersEndingWith(String number) {
    if (!checkOwner) {
      return addressDAO.findPhoneNumbersEndingWith(number);
    }

    return new LinkedList<PhoneNumber>();
  }
コード例 #7
0
  @Override
  public Option<Address> findAddressByPhoneNumber(String number) {
    if (!checkOwner) {
      return addressDAO.findAddressByCategoryAndPhoneNumber(category, number);
    }

    return new Empty();
  }
コード例 #8
0
 @Override
 public Option<Address> findAddressByOnwerAndFirstNameOrLastNameOrCompany(
     Integer ownerId, String firstName, String lastName, String company) {
   if (ownerId != null && isGlobalStore()) {
     return new Empty();
   }
   return addressDAO.findAddressByOwnerAndCategoryAndFirstNameOrLastNameOrCompany(
       ownerId, category, firstName, lastName, company);
 }
コード例 #9
0
 @Override
 public List<Address> createAddressListing(
     Integer userId,
     String search,
     String orderBy,
     SortOrder orderDir,
     int firstResult,
     int maxResults) {
   return addressDAO.createAddressListing(
       userId, category, checkOwner, search, orderBy, orderDir, firstResult, maxResults);
 }
コード例 #10
0
  @Override
  public Object createAddress(Address address, Integer ownerId) {
    if (editable) {
      address.setCategory(category);

      if (checkOwner) {
        address.setOwnerId(ownerId);
      }

      addressDAO.createAddress(address);
      return address.getId();
    }

    return null;
  }
コード例 #11
0
 @Override
 public void deleteAllAddresses() {
   addressDAO.deleteAddressesByCategory(category);
 }
コード例 #12
0
 @Override
 public Option<Address> findAddressByPhoneNumber(PhoneNumber phoneNumber) {
   return addressDAO.findAddressByCategoryAndPhoneNumber(category, phoneNumber);
 }
コード例 #13
0
 @Override
 public List<PhoneNumber> findAllPhoneNumbersByAddressDnSortedByCategoryList(
     String addressDn, String[] categories) {
   return addressDAO.findAllPhoneNumbersByAddressIdSortedByCategories(
       NumberTools.toInt(addressDn, -1), categories);
 }
コード例 #14
0
 @Override
 public List<Address> findAddressByNameStartsWith(String name) {
   return addressDAO.findAddressesByCategoryAndNameOrCompanyStartsWith(category, name);
 }
コード例 #15
0
 @Override
 public Option<Address> findAddressByLastNameOrCompany(String name) {
   return addressDAO.findAddressByCategoryAndLastNameOrCompany(category, name);
 }
コード例 #16
0
 @Override
 public Option<Address> findAddressByDn(Object addressDn) {
   return addressDAO.findAddressByDn(addressDn);
 }
コード例 #17
0
 public void bulkImport(Collection<Address> addresses) {
   addressDAO.bulkImport(addresses);
 }
コード例 #18
0
 @Override
 public void deleteAllAddressesOfOwner(Integer userId) {
   if (checkOwner) {
     addressDAO.deleteAllAddressesOfOnwerByCategory(category, userId);
   }
 }
コード例 #19
0
 @Override
 public boolean canBeDeleted() {
   return addressDAO.countAddressesByCategory(category) == 0;
 }
コード例 #20
0
 @Override
 public long countAddressesByOwnerAndSearch(Integer userId, String search) {
   return addressDAO.countAddressesByOwenrAndCategoryAndSearch(
       userId, checkOwner, category, search);
 }
コード例 #21
0
 @Override
 public void deleteAddressWithDn(Object addressDn) {
   if (editable) {
     addressDAO.deleteAddressWithDn(addressDn);
   }
 }
コード例 #22
0
 @Override
 public void updateAddress(Address address) {
   if (editable) {
     addressDAO.updateAddress(address);
   }
 }