www.pudn.com > PetTest.rar > BasePetDAO.java


package bo.base; 
 
import net.sf.hibernate.Hibernate; 
import net.sf.hibernate.Session; 
import com.dao.PetDAO; 
 
/** 
 * This class has been automatically generated by Hibernate Synchronizer. 
 * For more information or documentation, visit The Hibernate Synchronizer page 
 * at http://www.binamics.com/hibernatesync or contact Joe Hudson at joe@binamics.com. 
 * 
 * This is an automatically generated DAO class which should not be edited. 
 */ 
public abstract class BasePetDAO extends com.dao._RootDAO { 
 
	public static PetDAO instance; 
 
	/** 
	 * Return a singleton of the DAO 
	 */ 
	public static PetDAO getInstance () { 
		if (null == instance) instance = new PetDAO(); 
		return instance; 
	} 
 
	/** 
	 * bo.dao._RootDAO _RootDAO.getReferenceClass() 
	 */ 
	public Class getReferenceClass () { 
		return bo.Pet.class; 
	} 
 
	public bo.Pet load(java.lang.Integer key) 
		throws net.sf.hibernate.HibernateException { 
		return (bo.Pet) load(getReferenceClass(), key); 
	} 
 
	public bo.Pet load(java.lang.Integer key, Session s) 
		throws net.sf.hibernate.HibernateException { 
		return (bo.Pet) load(getReferenceClass(), key, s); 
	} 
 
	public bo.Pet loadInitialize(java.lang.Integer key, Session s) 
			throws net.sf.hibernate.HibernateException { 
		bo.Pet obj = load(key, s); 
		if (!Hibernate.isInitialized(obj)) { 
			Hibernate.initialize(obj); 
		} 
		return obj; 
	} 
 
	/** 
	 * Persist the given transient instance, first assigning a generated identifier. (Or using the current value 
	 * of the identifier property if the assigned generator is used.) 
	 * @param pet a transient instance of a persistent class 
	 * @return the class identifier 
	 */ 
	public java.lang.Integer save(bo.Pet pet) 
		throws net.sf.hibernate.HibernateException { 
		return (java.lang.Integer) super.save(pet); 
	} 
 
	/** 
	 * Persist the given transient instance, first assigning a generated identifier. (Or using the current value 
	 * of the identifier property if the assigned generator is used.) 
	 * Use the Session given. 
	 * @param pet a transient instance of a persistent class 
	 * @param s the Session 
	 * @return the class identifier 
	 */ 
	public java.lang.Integer save(bo.Pet pet, Session s) 
		throws net.sf.hibernate.HibernateException { 
		return (java.lang.Integer) super.save(pet, s); 
	} 
 
	/** 
	 * Either save() or update() the given instance, depending upon the value of its identifier property. By default 
	 * the instance is always saved. This behaviour may be adjusted by specifying an unsaved-value attribute of the 
	 * identifier property mapping. 
	 * @param pet a transient instance containing new or updated state 
	 */ 
	public void saveOrUpdate(bo.Pet pet) 
		throws net.sf.hibernate.HibernateException { 
		super.saveOrUpdate(pet); 
	} 
 
	/** 
	 * Either save() or update() the given instance, depending upon the value of its identifier property. By default the 
	 * instance is always saved. This behaviour may be adjusted by specifying an unsaved-value attribute of the identifier 
	 * property mapping. 
	 * Use the Session given. 
	 * @param pet a transient instance containing new or updated state. 
	 * @param s the Session. 
	 */ 
	public void saveOrUpdate(bo.Pet pet, Session s) 
		throws net.sf.hibernate.HibernateException { 
		super.saveOrUpdate(pet, s); 
	} 
 
	/** 
	 * Update the persistent state associated with the given identifier. An exception is thrown if there is a persistent 
	 * instance with the same identifier in the current session. 
	 * @param pet a transient instance containing updated state 
	 */ 
	public void update(bo.Pet pet) 
		throws net.sf.hibernate.HibernateException { 
		super.update(pet); 
	} 
 
	/** 
	 * Update the persistent state associated with the given identifier. An exception is thrown if there is a persistent 
	 * instance with the same identifier in the current session. 
	 * Use the Session given. 
	 * @param pet a transient instance containing updated state 
	 * @param the Session 
	 */ 
	public void update(bo.Pet pet, Session s) 
		throws net.sf.hibernate.HibernateException { 
		super.update(pet, s); 
	} 
 
	/** 
	 * Remove a persistent instance from the datastore. The argument may be an instance associated with the receiving 
	 * Session or a transient instance with an identifier associated with existing persistent state. 
	 * @param id the instance ID to be removed 
	 */ 
	public void delete(java.lang.Integer id) 
		throws net.sf.hibernate.HibernateException { 
		super.delete(load(id)); 
	} 
 
	/** 
	 * Remove a persistent instance from the datastore. The argument may be an instance associated with the receiving 
	 * Session or a transient instance with an identifier associated with existing persistent state. 
	 * Use the Session given. 
	 * @param id the instance ID to be removed 
	 * @param s the Session 
	 */ 
	public void delete(java.lang.Integer id, Session s) 
		throws net.sf.hibernate.HibernateException { 
		super.delete(load(id, s), s); 
	} 
 
	/** 
	 * Remove a persistent instance from the datastore. The argument may be an instance associated with the receiving 
	 * Session or a transient instance with an identifier associated with existing persistent state. 
	 * @param pet the instance to be removed 
	 */ 
	public void delete(bo.Pet pet) 
		throws net.sf.hibernate.HibernateException { 
		super.delete(pet); 
	} 
 
	/** 
	 * Remove a persistent instance from the datastore. The argument may be an instance associated with the receiving 
	 * Session or a transient instance with an identifier associated with existing persistent state. 
	 * Use the Session given. 
	 * @param pet the instance to be removed 
	 * @param s the Session 
	 */ 
	public void delete(bo.Pet pet, Session s) 
		throws net.sf.hibernate.HibernateException { 
		super.delete(pet, s); 
	} 
 
	/** 
	 * Re-read the state of the given instance from the underlying database. It is inadvisable to use this to implement 
	 * long-running sessions that span many business tasks. This method is, however, useful in certain special circumstances. 
	 * For example 
	 *  
	 */ 
	public void refresh (bo.Pet pet, Session s) 
		throws net.sf.hibernate.HibernateException { 
		super.refresh(pet, s); 
	} 
 
    public String getDefaultOrderProperty () { 
		return "Name"; 
    } 
 
}