org.springframework.samples.petclinic.util
Class EntityUtils

java.lang.Object
  extended by org.springframework.samples.petclinic.util.EntityUtils

public abstract class EntityUtils
extends java.lang.Object

Utility methods for handling entities. Separate from the BaseEntity class mainly because of dependency on the ORM-associated ObjectRetrievalFailureException.

Since:
29.10.2003
Author:
Juergen Hoeller, Sam Brannen
See Also:
BaseEntity

Constructor Summary
EntityUtils()
           
 
Method Summary
static
<T extends BaseEntity>
T
getById(java.util.Collection<T> entities, java.lang.Class<T> entityClass, int entityId)
          Look up the entity of the given class with the given id in the given collection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EntityUtils

public EntityUtils()
Method Detail

getById

public static <T extends BaseEntity> T getById(java.util.Collection<T> entities,
                                               java.lang.Class<T> entityClass,
                                               int entityId)
                                    throws org.springframework.orm.ObjectRetrievalFailureException
Look up the entity of the given class with the given id in the given collection.

Parameters:
entities - the collection to search
entityClass - the entity class to look up
entityId - the entity id to look up
Returns:
the found entity
Throws:
org.springframework.orm.ObjectRetrievalFailureException - if the entity was not found


Copyright © 2010. All Rights Reserved.