Package org.springframework.samples.petclinic

Examples of org.springframework.samples.petclinic.Entity


   */
  public static Entity getById(Collection entities, Class entityClass, int entityId)
      throws ObjectRetrievalFailureException {

    for (Iterator it = entities.iterator(); it.hasNext();) {
      Entity entity = (Entity) it.next();
      if (entity.getId().intValue() == entityId && entityClass.isInstance(entity)) {
        return entity;
      }
    }
    throw new ObjectRetrievalFailureException(entityClass, new Integer(entityId));
  }
View Full Code Here

TOP

Related Classes of org.springframework.samples.petclinic.Entity

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.