Package org.springframework.samples.petclinic

Examples of org.springframework.samples.petclinic.BaseEntity


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

    for (Iterator it = entities.iterator(); it.hasNext();) {
      BaseEntity entity = (BaseEntity) 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.BaseEntity

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.