|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.samples.petclinic.hibernate.HibernateClinic
@Repository @Transactional public class HibernateClinic
Hibernate implementation of the Clinic interface.
The mappings are defined in "petclinic.hbm.xml", located in the root of the class path.
Note that transactions are declared with annotations and that some methods contain "readOnly = true" which is an optimization that is particularly valuable when using Hibernate (to suppress unnecessary flush attempts for read-only operations).
| Constructor Summary | |
|---|---|
HibernateClinic(org.hibernate.SessionFactory sessionFactory)
|
|
| 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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HibernateClinic(org.hibernate.SessionFactory sessionFactory)
| Method Detail |
|---|
@Transactional(readOnly=true) public java.util.Collection<Vet> getVets()
ClinicVets from the data store.
getVets in interface ClinicCollection of Vets@Transactional(readOnly=true) public java.util.Collection<PetType> getPetTypes()
ClinicPetTypes from the data store.
getPetTypes in interface ClinicCollection of PetTypes@Transactional(readOnly=true) public java.util.Collection<Owner> findOwners(java.lang.String lastName)
ClinicOwners from the data store by last name,
returning all owners whose last name starts with the given name.
findOwners in interface CliniclastName - Value to search for
Collection of matching Owners
(or an empty Collection if none found)@Transactional(readOnly=true) public Owner loadOwner(int id)
ClinicOwner from the data store by id.
loadOwner in interface Clinicid - the id to search for
Owner if found@Transactional(readOnly=true) public Pet loadPet(int id)
ClinicPet from the data store by id.
loadPet in interface Clinicid - the id to search for
Pet if foundpublic void storeOwner(Owner owner)
ClinicOwner to the data store, either inserting or updating it.
storeOwner in interface Clinicowner - the Owner to saveBaseEntity.isNew()public void storePet(Pet pet)
ClinicPet to the data store, either inserting or updating it.
storePet in interface Clinicpet - the Pet to saveBaseEntity.isNew()public void storeVisit(Visit visit)
ClinicVisit to the data store, either inserting or updating it.
storeVisit in interface Clinicvisit - the Visit to saveBaseEntity.isNew()
public void deletePet(int id)
throws org.springframework.dao.DataAccessException
ClinicPet from the data store.
deletePet in interface Clinicorg.springframework.dao.DataAccessException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||