package com.laoer.base; import java.io.Serializable; import java.math.BigDecimal; import java.sql.Timestamp; import java.util.Calendar; import java.util.Date; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import org.springframework.orm.hibernate.support.HibernateDaoSupport; import net.sf.hibernate.Criteria; import net.sf.hibernate.HibernateException; import net.sf.hibernate .Query; import net.sf.hibernate.Session; import net.sf.hibernate.Transaction; import net.sf.hibernate.SessionFactory; import net.sf.hibernate.cfg.configuration; import net.sf.hibernate.EXPIPRESSION. Expression; import net.sf.hibernate.expression.Order; import net.sf.hibernate.type.Type;. / ** * 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. * / public abstract class _baserootdao extends Hibernatedaosupport {P rotected static Map sessionFactoryMap = new HashMap (); protected static ThreadLocal threadedSessions = new ThreadLocal (); / ** * Configure the session factory by reading hibernate config file * / public static void initialize () throws HibernateException {initialize ((String) null );} / ** * Configure the session factory by reading hibernate config file * @param configFileName the name of the configuration file * / public static void initialize (String configFileName) throws HibernateException {if (null == configFileName && sessionFactoryMap.size ( )> 0) Return; Else IF (null! = SessionFactoryMap.get (configFileName)) Return; else {configure cfg = new configuration (); if (null ==
configFileName) cfg.configure (); else cfg.configure (configFileName); setSessionFactory (configFileName, cfg.buildSessionFactory ());}} / ** * Set the session factory * / // protected static void setSessionFactory (SessionFactory sessionFactory) { // setSessionFactory ((String) null, sessionFactory); //} / ** * Set the session factory * / protected static void setSessionFactory (String configFileName, SessionFactory sessionFactory) {sessionFactoryMap.put (configFileName, sessionFactory);} / ** * Return the SessionFactory that is to be used by these DAOs. Change this * and implement your own strategy if you, for example, want to pull the SessionFactory * from the JNDI tree. * / // protected SessionFactory getSessionFactory () throws HibernateException { // return getSessionFactory (getConfigurationFileName ()); //} private static SessionFactory getSessionFactory (String configFile) throws HibernateException {if (sessionFactoryMap.size () == 1) return (SessionFactory) sessionFactoryMap.values (). toArray () [0]; else {SessionFactory sessionFactory = (SessionFactory) sessionFactoryMap.get (configFile); if (null == sessionFactory) if (null == configFile) throw new RuntimeException ( "The session factory has not been initialized." ); else throw new RuntimeException ( "The session factory for '" configFile "' has not been initialized."); else return sessionFactory;}} / ** * return a new Session object that must be closed when the work has BEEN completed. * @return the active session * / // protected session getsession () throws hibernateException {// return createness ();
//} / ** * Return a new Session object that must be closed when the work has been completed * @return the active Session * / public static Session createSession () throws HibernateException {return createSession (null);.} / ** * Return a new Session object that must be closed when the work has been completed. * @param configFile the config file must match the meta attribute "config-file" in the hibernate mapping file * @return the active Session * / public static Session createSession (String configFile) throws HibernateException {java.util.Stack sessionStack = (java.util.Stack) threadedSessions.get (); Session session = null; if (null == sessionStack) {sessionStack = new java.util.Stack ( ThreadedSssions.Set (sessionstack);}} (sessionstack.size ()> 0) {Object [] arr = (object []) sessionStack.peek (); string cf = (string) arr [0]; IF NULL == CF) {session = (session) Arr [1];} else if (null! = cf && null! = configfile) {if (cf.equals (configfile) session = (session) arr [1]; } i (null == session) {session = getsessionFactory (configfile) .openSession (); arr = new object [2]; arr [0] = configfile; arr [1] = session; sessionstack.push (arr);}} else {session = getsessionFactory (configfile) .openSession (); object [] arr = new object [2]; arr = new object [2]; arr [0] = configfile; arr [1] = session; sessionstack.push (arr); } return session;} / ** * return the name of the configuration file to be used with this DAO or null if default * / public String getConfigurationFileName () {return null;} / ** * return the specific Object class that will be Used for class-specific * importation of this dao. * @
return the reference Class * / protected abstract Class getReferenceClass (); / ** * Close the session * / public void closeSession () throws HibernateException {java.util.Stack sessionStack = (java.util.Stack) threadedSessions.get (); IF (null! = sessionstack) {Object [] arr = (object []) sessionStack.peek (); string cf = (string) arr [0]; if (null == cf) {session session = (session) arr [1]; session.close (); sessionStack.pop ();} else {String configurationFile = getConfigurationFileName (); if (! null = configurationFile && configurationFile.equals (cf)) {Session session = (Session) arr [1 ]; session.close (); sessionStack.pop ();}}}} / ** * Begin the transaction related to the session * / public Transaction beginTransaction (Session s) throws HibernateException {return s.beginTransaction ();} / ** * Commit the given transaction * / public void commitTransaction (Transaction t) throws HibernateException {t.commit ();}. / ** * Execute a query * @param query a query expressed in Hibernate's query l anguage * @return a distinct list of instances (or arrays of instances) * / public java.util.List find (String query) throws HibernateException {Session s = null; try {s = getSession (); return find (query, s } finally {closesession ();}} / ** * Perform A Find But Use the session given instead of create a new one. * @Param Query a Query Expressed in Hibernate's Query Language * @s the session to us * / Public Java.util.List Find (String Query, Session S) THROWS HibernateException {Return S.Find (Query);
} / ** * Return all objects related to the implementation of this DAO * / public java.util.List findAll with no filter () throws HibernateException {Session s = null;. Try {s = getSession (); return findAll (s );} finally {closesession ();}} / ** * Return all objectation of this dao with no filter. * Use the session given. * @Param s the session * / public java.util.list FindAll (Session s) throws HibernateException {return findAll (s, getDefaultOrderProperty ());} / ** * return all objects related to the implementation of this DAO with no filter * / public java.util.List findAll (String orderProperty) throws. HibernateException {Session s = null; try {s = getSession (); return findAll (s, orderProperty);} finally {closeSession ();}} / ** * return all objects related to the implementation of this DAO with no filter. * Use the session given. * @Param s the session * / public java.util.list FindAll (session s, string orderproperty) throws hibernateException {crite RIA crit = cretecriteria (s); if (null! = orderproperty) crit.addorder (Order.asc (ORDERPROPERTY)); return crit.list ();} / ** * Return All Objects related to the importation of this Dao with a filter. * use the session given. * @param propName the name of the property to use for filtering * @param filter the value of the filter * / protected java.util.List findFiltered (String propName, Object filter) throws HibernateException { return findFiltered (propName, filter, getDefaultOrderProperty ());} / ** * return all objects related to the implementation of this DAO with a filter * use the session given * @param propName the name of the property to use for filtering.. * @
param filter the value of the filter * @param orderProperty the name of the property used for ordering * / protected java.util.List findFiltered (String propName, Object filter, String orderProperty) throws HibernateException {Session s = null; try {s = getSession (); return findFiltered (s, propName, filter, getDefaultOrderProperty ());} finally {closeSession ();}} / ** * return all objects related to the implementation of this DAO with a filter * Use the session given. . * @param s the Session * @param propName the name of the property to use for filtering * @param filter the value of the filter * @param orderProperty the name of the property used for ordering * / protected java.util.List findFiltered (Session s, String propName, Object filter, String orderProperty) throws HibernateException {Criteria crit = createCriteria (s); crit.add (Expression.eq (propName, filter)); if (! null = orderProperty) crit.addOrder (Order .asc (OrderProperty)); return crit.list ();} / ** * Obtain an instance of Query for a named query string defined in the mapping file * @param name the name of a query defined externally * @return Query * / public java.util.List getNamedQuery (String name) throws HibernateException {Session s = null;. Try { S = getsession (); return getnamedquery (Name, s);} finally {closesession ();}} / ** * Obtain an instance of query for a named query string defined in the mapping file. * Use the session given. * @param name the name of a query defined externally * @param s the Session * @return Query * / public java.util.List getNamedQuery (String name, Session s) throws HibernateException {Query q = s.getNamedQuery (name); return Q.List ();
} / ** * Obtain an instance of Query for a named query string defined in the mapping file. * Use the parameters given. * @Param name the name of a query defined externally * @param params the parameter array * @return Query * / public java.util.List getNamedQuery (String name, Serializable [] params) throws HibernateException {Session s = null; try {s = getSession (); return getNamedQuery (name, params, s);} finally {closeSession (); }} / ** * Obtain an instance of Query for a named query string defined in the mapping file. * Use the parameters given and the Session given. * @param name the name of a query defined externally * @param params the parameter array * @s the Session * @return Query * / public java.util.List getNamedQuery (String name, Serializable [] params, Session s) throws HibernateException {Query q = s.getNamedQuery (name); if (! null = params) {for (int i = 0; i return Query * / public java.util.List getNamedQuery (String name, Map params, Session s) throws HibernateException {Query q = s.getNamedQuery (name); if (! null = params) {for (Iterator i = params.entrySet () .iterator (); {map.entry entry = (map.entry) i.next (); setParameterValue (Q, String) entry.getKey (), entry.getValue () ;}} return q.list ();.} / ** * Execute a query * @param query a query expressed in Hibernate's query language * @return a distinct list of instances (or arrays of instances) * / public java.util .List Find (String query) throws hibernateException {session s = null; try {s = getsession (); returnof (query, obj, type, s);} finally {closesession ();}} / ** * Perform a find but use the session given instead of creating a new one. * @param query a query expressed in Hibernate's query language * @s the Session to use * / public java.util.List find (String query, Object Obj, Type Type, Session S) throws HibernateException {Return S.Find query, obj, type);} / ** * Execute a query * @param query a query expressed in Hibernate's query language * @return a distinct list of instances (or arrays of instances) * / public java.util.List find. (String query, object [] obj, type [] type) throws hibernateException {session s = null; try {s = getsession (); returnof (query, obj, type, s);} finally {closesession ();} } / ** * Perform A Find But Use the session given instead of create a new one. * @Param query a query expressed in hibernate's query language * @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ S the session to use * / public java.util.list Find (string query, object [] obj, type [] type, session s) throws hibernateException {return s.find (query, obj, type);} / ** * return a Criteria object that relates to the DAO's table * A session will be created if an open one is not located This session must be closed * / protected Criteria createCriteria () throws HibernateException {Session s = getSession ();..! return createCriteria (s);} / ** * return a Criteria object that relates to the DAO's table * / protected Criteria createCriteria (Session s) throws HibernateException {return s.createCriteria (getReferenceClass ());} / ** * return the property of the class you would like to use for default ordering * @return the property name * / public String getDefaultOrderProperty () {return null;} / ** * Convenience method to set paramers in the query given based on the actual object type in passed IN as the value. * You May Need to add more functionaly to this as desired (or not use this at all) . * @Param query the Query to set * @param position the ordinal position of the current parameter within the query * @param value the object to set as the parameter * / protected void setParameterValue (Query query, int position, Object value) { IF (null == value) {return;}} query.setBoolean (position, ((Boolean) value) .BooleanValue ());} else if (value instanceof string) {query.setstring Position, (string) value;} else if (value instanceof integer) {query.setInteger ((Integer) .intValue ());} else if (value instanceof long) {query.setlong (position, (Long) value) .longvalue ()); } else if (value instanceof float) {query.setfloat (position, (float) value);} else if (value instanceof double) {query.setdouble (position, (double). DoubleValue. DoubleValue ());} else if (value instanceof bigdecimal) {query.setBigDecimal (position, (value instanceof Byte) {query.setbyte (position, ((byte) value) .bytevalue () } Else if (value instanceof calendar {query.setcalendar;} else if (value instanceof character) {query.setCharacter (position, (character) value .charvalue ()); } else if (value instanceof Timestamp) {query.setTimestamp (position, (Timestamp) value);} else if (value instanceof Date) {query.setDate (position, (Date) value);} else if (value instanceof Short) {Query.SetShort (position, (short) Value) .shortvalue ());}} / ** * Convenience method method to set paramers in the query given based on the actual object type in passed in as the value. * You May Need to add more functionaly to this as desire d (or not use this at all). * @param query the Query to set * @param key the key name * @param value the object to set as the parameter * / protected void setParameterValue (Query query, String key, Object value ) {if (null == key || null == value) {Return;} else if (value instanceof boolean) {query.setBoolean (key, (boolean) value) .BooleanValue ());} else if InstanceOf string) {query.setString (key, value);} else if (value instanceof integer) {query.setinteger (key, ((Integer) .intValue ());} Else IF (Value InstanceOf long); ) {query.setlong (key, ((long) value);} else if (value instanceof float) {query.setfloat (key, ((float) value) .floatValue ()); } else if (value instanceof double) {query.setdouble (key, ((double) value) .doubleValue ());} else if (value instanceof bigdecimal) {query.setBigDecimal (key, (bigdecimal);} else IF (value instanceof byte) {query.setByte (key, (byte) value);} else if (value instanceof calendar {query.setcalendar);} else if ( value instanceof Character) {query.setCharacter (key, ((Character) value) .charValue ());} else if (value instanceof Timestamp) {query.setTimestamp (key, (Timestamp) value);} else if (value instanceof Date) {query.setdate (key, (value);} else if (value instanceof short) {query.setshst (key, (short) value) .shortvalue ());}} / ** * buy by . the base DAO classes but here for your modification * Load object matching the given key and return it * / protected Object load (Class refClass, Serializable key) throws HibernateException {Session s = null; try {s = getSession (); return load (refclass, key, s);} finally {closesession (); } / ** * Used by the base DAO classes but here for your modification * Load object matching the given key and return it. * / Protected Object load (Class refClass, Serializable key, Session s) throws HibernateException {return s.load ( refClass, key);} / ** * Used by the base DAO classes but here for your modification * 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) * / protected Serializable save (Object obj) throws HibernateException {Transaction t = null; Session s = null; try {s = getSession (); t = beginTransaction (s); Serializable rtn = save (obj, s); CommitTransaction (T); Return RTN; } catch (hibernateException e) {if (null! = t) T. Rollback (); throw e;} finally {closesession ();}} / ** * buy by the base dao classes but here for your model * 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.) * / protected Serializable save (Object obj, Session s) throws HibernateException {return s.save (obj );.} / ** * Used by the base DAO classes but here for your modification * Either save () or update () the given instance, depending upon the value of its * identifier property * / protected void saveOrUpdate (Object obj) THROWS HibernateException {Transaction T = NULL; session s = null; try {s = getsession (); t = beginTransaction (s); saveorupdate (Obj, s); committransaction (t);} catch (hibernateException E) {IF (Null ! = T) T. Rollback (); throw e;} finally {closesession ();}} / ** * buy by the base dao classes but here for your model * Either SAV e () or update () the given instance, depending upon the value of its * identifier property * / protected void saveOrUpdate (Object obj, Session s) throws HibernateException {s.saveOrUpdate (obj);}. / ** * Used by the base DAO classes but here for your modification * 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 obj a transient instance containing updated state * / protected void update (object obj) throws hibernateException {Transaction T = null; session s = null; try {s = getsession (); t = begintransaction (s); Update (Obj, s); committransaction (t); } catch (hibernateException e) {if (null! = t) T. Rollback (); throw e;} finally {closesession ();}} / ** * buy by the base dao classes but here for your model * Update T 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 obj a transient instance containing updated state * @param s the Session * / protected void update ( Object obj, Session s) throws HibernateException {s.update (obj);}. / ** * Used by the base DAO classes but here for your modification * 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 * / protected void delete (Object obj) throws HibernateException {Transaction t = null;. Session s = null; try {s = getSession (); t = beginTransaction ( s); delete (obj, s); committransaction (t);} catch (Hibe RNateException E) {if (null! = t) T. Rollback (); throw e;} finally {closesession ();}} / ** * buy by the base dao classes but here for your model * 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 * / protected void delete (Object obj, Session s) throws HibernateException {s.delete (obj)..; } / ** * Used by the base DAO classes but here for your modification * 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 * / protected void refresh (Object obj, Session s) throws HibernateException {s.refresh (obj);}.} the above is the root of the code package com.laoer.base dao class; import net.sf.hibernate.Hibernate; import net.sf.hibernate.Session; import com.laoer.dao.EbGoodsDAO; / ** * 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 BaseEbGoodsDAO extends com .laoer.dao._rootdao imports ibaseebgoodsdao {public static ebgoodsdao instance; / ** * Re turn a singleton of the DAO * / public static EbGoodsDAO getInstance () {if (null == instance) instance = new EbGoodsDAO (); return instance;} / ** * com.laoer.dao._RootDAO _RootDAO.getReferenceClass () * / public Class getReferenceClass () {return com.laoer.EbGoods.class;} public com.laoer.EbGoods load (java.lang.String key) throws net.sf.hibernate.HibernateException {return (com.laoer.EbGoods) load (getReferenceClass (), key);} public com.laoer.EbGoods load (java.lang.String key, Session s) throws net.sf.hibernate.HibernateException {return (com.laoer.EbGoods) load (getReferenceClass (), Key, s); } Public com.laoer.EbGoods loadInitialize (java.lang.String key, Session s) throws net.sf.hibernate.HibernateException {com.laoer.EbGoods 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 ebGoods a transient instance of a persistent class * @return the class identifier * / public java.lang.String save (com.laoer.EbGoods ebGoods) throws net.sf.hibernate.HibernateException {return (java.lang.String ) super.save (ebGoods);..} / ** * 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 ebgoods a transient instance of a personistent class * @Param s the session * @return the class identifier * / public java.lang.strin G save (com.laoer.ebgoods ebgoods, session s) throws net.sf.hibtion {return (java.lang.string) Super.save (ebgoods, 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 ebGoods a transient instance CONTAINING New Or Updated State * / Public Void SaveorUpdate (com.laoer.ebgoods ebgoods) throws net.sf.hibernate.hibernateException {super.saveorUpdate (ebgoods); } / ** * 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 ebGoods a transient instance containing new or updated state. * @param s the Session. * / public void saveOrUpdate (com.laoer.EbGoods ebGoods, Session s) throws net.sf .hibernate.HibernateException {super.saveOrUpdate (ebGoods, 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 ebGoods a transient instance containing updated state * / public void update (com.laoer.EbGoods ebGoods) throws net.sf.hibernate.HibernateException {super.update (ebGoods);} / ** * Update the persistent state associated with the Given Identifier. An Exception Is Thrown if The Is A PERS istent * instance with the same identifier in the current session. * Use the Session given. * @param ebGoods a transient instance containing updated state * @param the Session * / public void update (com.laoer.EbGoods ebGoods, Session s) throws net.sf.hibernate.HibernateException {super.update (ebGoods, 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. * @Param id the instance id to be removed * / public void delete (java.lang.string id) throws net.sf.hibernate.hibernateException {super.delete (loading (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.string 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 ebGoods the instance to be removed * / public void delete (com.laoer.EbGoods ebGoods) throws net.sf.hibernate.HibernateException {super.delete (ebGoods);} / ** * 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 EX isting persistent state. * Use the Session given. * @param ebGoods the instance to be removed * @param s the Session * / public void delete (com.laoer.EbGoods ebGoods, Session s) throws net.sf.hibernate.HibernateException { super.delete (ebGoods, 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 ** WHERE A DATABASE TRIGGER Alters The Object State Upon Insert Or Update * After EXECUTING DIRECT SQL (Eg. a mass update) in the same session * After inserting a blob or clob * * / Public void refresh (com.laoer.EbGoods ebGoods, Session s) throws {super.refresh (ebGoods, s);} net.sf.hibernate.HibernateException public String getDefaultOrderProperty () {return null;}} The above is a specific Realize the root class, automatically generated. / * * Created on 2005-1-8 * * Todo to change the template for this generated file go to * window - preferences - java - code style - code templates * / package com.laoer.base; import net.sf.hibernate .HibernateException; import net.sf.hibernate.Session; import com.laoer.EbClass; / ** * @author Administrator * * TODO to change the template for this generated type comment go to * Window - Preferences - Java - Code Style - Code Templates * / public interface IBaseEbClassDAO {/ ** * com.laoer.dao._RootDAO _RootDAO.getReferenceClass () * / public Class getReferenceClass (); public com.laoer.EbClass load (java.lang.String key) throws net. sf.hibernate.HibernateException; public com.laoer.EbClass load (java.lang.String key, Session s) throws net.sf.hibernate.HibernateException; public com.laoer.EbClass loadInitialize (java.lang.String key, Session s "throws net.sf.hibelnate.hibernateException; / ** * 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 ebClass a transient instance of a persistent class * @return the class identifier * / public java.lang.String save (com.laoer.EbClass ebClass) throws net. sf.hibernate.HibernateException; / ** * 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.. ebClass a transient instance of a persistent class * @param s the Session * @return the class identifier * / public java.lang.String save (com.laoer.EbClass ebClass, Session s) net.sf.hibernate.HibernateException throws; / ** * 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 ebClass a transient instance containing new or updated state * / public void saveOrUpdate (com.laoer.EbClass ebClass) throws net.sf.hibernate.HibernateException; / ** * 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 ebClass . a transient instance containing new or updated state * @param s the Session * / public void saveOrUpdate (com.laoer.EbClass ebClass, Session s) throws net.sf.hibernate.HibernateException;. / ** * 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 ebClass a transient instance containing updated state * / public void update (com.laoer.EbClass ebClass) throws net.sf.hibernate.HibernateException.; / ** * 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 ebClass a transient instance containing updated state * @Param the session * / public void update (com.laoer.ebclass ebclass, session s) throws net.sf.hibption; / ** * 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.String id) throws net.sf.hibernate.HibernateException; / ** * 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.String id, Session s) throws net.sf.hibernate .HibernateException;.. / ** * 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 ebClass the instance to be removed * / Public void delete (com.laoer.EbClass ebClass) throws net.sf.hibernate.HibernateException;. / ** * 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 ebClass the instance to be removed * @param s the Session * / public void delete (com.laoer.EbClass ebClass, Session s) throws net.sf .Hibernate.hibernateException; / ** * 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 ** WHERE A DATABASE TRIGGER Alters The Object State Upon Insert Or Update * After EXECUTING DIRECT SQL (Eg. a mass update) in the same session * After inserting a blob or clob * * / public void refresh (com.laoer.ebclass ebclass, session s) throws net.sf.hibension; public string getDefaultOrderProperty ();} is an interface that eclipse is reconstructed. (For Spring) QQ: 39459358