Package org.springframework.orm

Examples of org.springframework.orm.ObjectRetrievalFailureException


     */
    public ConstructionDefectZone getConstructionDefectZone(final Integer constructionDefectId) {
        ConstructionDefectZone constructionDefect = (ConstructionDefectZone) getHibernateTemplate().get(ConstructionDefectZone.class, constructionDefectId);
        if (constructionDefect == null) {
            log.warn("uh oh, constructionDefect with constructionDefectId '" + constructionDefectId + "' not found...");
            throw new ObjectRetrievalFailureException(ConstructionDefectZone.class, constructionDefectId);
        }

        return constructionDefect;
    }
View Full Code Here


     */
    public ConstructionExample getConstructionExample(final Integer exampleId) {
        ConstructionExample constructionExample = (ConstructionExample) getHibernateTemplate().get(ConstructionExample.class, exampleId);
        if (constructionExample == null) {
            log.warn("uh oh, constructionExample with exampleId '" + exampleId + "' not found...");
            throw new ObjectRetrievalFailureException(ConstructionExample.class, exampleId);
        }

        return constructionExample;
    }
View Full Code Here

          "SELECT id, first_name, last_name, address, city, telephone FROM owners WHERE id=?",
          ParameterizedBeanPropertyRowMapper.newInstance(Owner.class),
          id);
    }
    catch (EmptyResultDataAccessException ex) {
      throw new ObjectRetrievalFailureException(Owner.class, new Integer(id));
    }
    loadPetsAndVisits(owner);
    return owner;
  }
View Full Code Here

          "SELECT id, name, birth_date, type_id, owner_id FROM pets WHERE id=?",
          new JdbcPetRowMapper(),
          id);
    }
    catch (EmptyResultDataAccessException ex) {
      throw new ObjectRetrievalFailureException(Pet.class, new Integer(id));
    }
    Owner owner = loadOwner(pet.getOwnerId());
    owner.addPet(pet);
    pet.setType(EntityUtils.getById(getPetTypes(), PetType.class, pet.getTypeId()));
    loadVisits(pet);
View Full Code Here

    for (T entity : entities) {
      if (entity.getId().intValue() == entityId && entityClass.isInstance(entity)) {
        return entity;
      }
    }
    throw new ObjectRetrievalFailureException(entityClass, new Integer(entityId));
  }
View Full Code Here

  }

  public Account getAccount(Long id) {
    Account account = accountsById.get(id);
    if (account == null) {
      throw new ObjectRetrievalFailureException(Account.class, id);
    }
    return account;
  }
View Full Code Here

  }

  public Account getAccount(Long id) {
    Account account = accountsById.get(id);
    if (account == null) {
      throw new ObjectRetrievalFailureException(Account.class, id);
    }
    return account;
  }
View Full Code Here

  }

  public Restaurant findByMerchantNumber(String merchantNumber) {
    Restaurant restaurant = (Restaurant) restaurantsByMerchantNumber.get(merchantNumber);
    if (restaurant == null) {
      throw new ObjectRetrievalFailureException(Restaurant.class, merchantNumber);
    }
    return restaurant;
  }
View Full Code Here

  }

  public Account findByCreditCard(String creditCardNumber) {
    Account account = accountsByCreditCard.get(creditCardNumber);
    if (account == null) {
      throw new ObjectRetrievalFailureException(Account.class, creditCardNumber);
    }
    return account;
  }
View Full Code Here

  }

  public Account getAccount(Long id) {
    Account account = accountsById.get(id);
    if (account == null) {
      throw new ObjectRetrievalFailureException(Account.class, id);
    }
    return account;
  }
View Full Code Here

TOP

Related Classes of org.springframework.orm.ObjectRetrievalFailureException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.