org.springframework.samples.petclinic
Interface Clinic

All Known Implementing Classes:
EntityManagerClinic, HibernateClinic, SimpleJdbcClinic

public interface Clinic

The high-level PetClinic business interface.

This is basically a data access object. PetClinic doesn't have a dedicated business facade.

Author:
Ken Krebs, Juergen Hoeller, Sam Brannen

Method Summary
 void deletePet(int id)
          Deletes a Pet from the data store.
 java.util.Collection<Owner> findOwners(java.lang.String lastName)
          Retrieve Owners from the data store by last name, returning all owners whose last name starts with the given name.
 java.util.Collection<PetType> getPetTypes()
          Retrieve all PetTypes from the data store.
 java.util.Collection<Vet> getVets()
          Retrieve all Vets from the data store.
 Owner loadOwner(int id)
          Retrieve an Owner from the data store by id.
 Pet loadPet(int id)
          Retrieve a Pet from the data store by id.
 void storeOwner(Owner owner)
          Save an Owner to the data store, either inserting or updating it.
 void storePet(Pet pet)
          Save a Pet to the data store, either inserting or updating it.
 void storeVisit(Visit visit)
          Save a Visit to the data store, either inserting or updating it.
 

Method Detail

getVets

java.util.Collection<Vet> getVets()
                                  throws org.springframework.dao.DataAccessException
Retrieve all Vets from the data store.

Returns:
a Collection of Vets
Throws:
org.springframework.dao.DataAccessException

getPetTypes

java.util.Collection<PetType> getPetTypes()
                                          throws org.springframework.dao.DataAccessException
Retrieve all PetTypes from the data store.

Returns:
a Collection of PetTypes
Throws:
org.springframework.dao.DataAccessException

findOwners

java.util.Collection<Owner> findOwners(java.lang.String lastName)
                                       throws org.springframework.dao.DataAccessException
Retrieve Owners from the data store by last name, returning all owners whose last name starts with the given name.

Parameters:
lastName - Value to search for
Returns:
a Collection of matching Owners (or an empty Collection if none found)
Throws:
org.springframework.dao.DataAccessException

loadOwner

Owner loadOwner(int id)
                throws org.springframework.dao.DataAccessException
Retrieve an Owner from the data store by id.

Parameters:
id - the id to search for
Returns:
the Owner if found
Throws:
org.springframework.dao.DataRetrievalFailureException - if not found
org.springframework.dao.DataAccessException

loadPet

Pet loadPet(int id)
            throws org.springframework.dao.DataAccessException
Retrieve a Pet from the data store by id.

Parameters:
id - the id to search for
Returns:
the Pet if found
Throws:
org.springframework.dao.DataRetrievalFailureException - if not found
org.springframework.dao.DataAccessException

storeOwner

void storeOwner(Owner owner)
                throws org.springframework.dao.DataAccessException
Save an Owner to the data store, either inserting or updating it.

Parameters:
owner - the Owner to save
Throws:
org.springframework.dao.DataAccessException
See Also:
BaseEntity.isNew()

storePet

void storePet(Pet pet)
              throws org.springframework.dao.DataAccessException
Save a Pet to the data store, either inserting or updating it.

Parameters:
pet - the Pet to save
Throws:
org.springframework.dao.DataAccessException
See Also:
BaseEntity.isNew()

storeVisit

void storeVisit(Visit visit)
                throws org.springframework.dao.DataAccessException
Save a Visit to the data store, either inserting or updating it.

Parameters:
visit - the Visit to save
Throws:
org.springframework.dao.DataAccessException
See Also:
BaseEntity.isNew()

deletePet

void deletePet(int id)
               throws org.springframework.dao.DataAccessException
Deletes a Pet from the data store.

Throws:
org.springframework.dao.DataAccessException


Copyright © 2010. All Rights Reserved.