/**
 * 
 */
package PetStore.dao.impl;


import org.hibernate.Session;
import org.hibernate.Transaction;

import PetStore.dao.PetDao;
import PetStore.domain.Pet;


/**
 * @author Cheer
 * @date 2017年10月25日
 * @time 下午2:45:03
 */
public class PetDaoImpl implements PetDao
{
    @Override
    public void save(Pet pet, Session session, Transaction tx)
    {
        session.persist(pet);
        session.flush();
    }

    @Override
    public void delete(Pet pet, Session session, Transaction tx)
    {
        session.delete(session.get(Pet.class, pet.getId()));
        session.flush();
    }

    @Override
    public void update(Pet pet, Session session, Transaction tx)
    {

    }

}