Method Summary |
Transaction |
Begintransaction() Starts a work unit and returns the associatedTransaction)Object. |
Void |
Cancelquery() Terminate the current query. |
Void |
Clear() Completely clear this session. |
Connection |
Close() Stop thisSessionBy interrupting the JDBC connection and clearing it. |
Connection |
Connection() Obtain the JDBC connection of this session.If this session uses an active collection release policy (for example, CMT-container controls the transaction environment), the current application is responsible for closing the connection to this call. |
Boolean |
Contains(Object object) Check whether the object instance matches the currentSessionAssociation (whether it is in the persistent State ). |
Criteria |
Createcriteria(Class persistentclass) Creates a newCriteriaInstance. |
Criteria |
Createcriteria(Class persistentclass, string alias) Creates a new object based on the given object class or its superclass.CriteriaInstance, and assign it (entity class) an alias. |
Criteria |
Createcriteria(String entityname) Creates a new object based on the name of the given object.CriteriaInstance. |
Criteria |
Createcriteria(String entityname, string alias) Creates a new object based on the name of the given object.CriteriaInstance, and assign it (entity class) an alias |
Query |
Createfilter(Object collection, string querystring) Creates a newQueryInstance. |
Query |
Createquery(String querystring) Creates a new hql query condition.QueryInstance. |
Sqlquery |
Createsqlquery(String querystring) Create a newSqlqueryInstance. |
Void |
Delete(Object object) Removes an instance of a persistent object from a database. |
Void |
Delete(String entityname, object) Removes an instance of a persistent object from a database. |
Void |
Disablefilter(String filtername) Disable the name filter of the current session. |
Connection |
Disconnect() DisconnectedSessionAnd the current JDBC connection. |
Filter |
Enablefilter(String filtername) Open the name filter of the current session. |
Void |
Evict(Object object) Clears the current object instance from the session cache. |
Void |
Flush() Force commit refresh (flush)Session. |
Object |
Get(Class clazz, serializable ID) Returns the instance of the Persistent Object Based on the given identifier and object class. If no persistence object instance meets the condition, null is returned. |
Object |
Get(Class clazz, serializable ID, lockmode) Returns the instance of the Persistent Object Based on the given identifier and object class. If no persistence object instance meets the condition, null is returned. |
Object |
Get(String entityname, serializable ID) Returns the persistence instance that matches the given object name and identifier. If no persistence instance is matched, null is returned. |
Object |
Get(String entityname, serializable ID, lockmode) Returns the persistence instance that matches the given object class and identifier. If no persistence instance exists, null is returned. |
Cachemode |
Getcachemode() Obtain the current cache mode. |
Lockmode |
Getcurrentlockmode(Object object) Checks the current lock level of a given object. |
Filter |
Getenabledfilter(String filtername) Obtain a filter based on the name ). |
Entitymode |
Getentitymode() Obtains the effective entity mode of this session. |
String |
Getentityname(Object object) Returns the Object Name of a persistent object. |
Flushmode |
Getflushmode() Obtain the current flush mode. |
Serializable |
Getidentifier(Object object) Obtain the given object instance inSessionIf the instance is in the free status (transient) orSessionAssociation throws an exception. |
Query |
Getnamedquery(String queryname) ObtainsQuery)Instance. |
Session |
Getsession(Entitymode) Starts a new valid session based on the given entity mode. |
Sessionfactory |
Getsessionfactory() ObtainSessionfactoryInstance. |
Sessionstatistics |
Getstatistics() Obtains the statistics of this session. |
Transaction |
Gettransaction() ObtainTransaction)Instance. Instance associated with this session. |
Boolean |
Isconnected() Check the currentSessionWhether it is in the connection status. |
Boolean |
Isdirty() CurrentSessionIs there any changes (data status) that need to be synchronized with the database? If we refresh the Commit (flush) session, will there be SQL Execution? |
Boolean |
Isopen() Check the currentSessionWhether or not it is still enabled. |
Object |
Load(Class theclass, serializable ID) If a qualified instance exists, a persistent instance is returned Based on the given entity class and identifier. |
Object |
Load(Class theclass, serializable ID, lockmode) If a qualified instance exists, a persistent instance is returned Based on the given entity class, identifier, and specified lock level. |
Void |
Load(Object object, serializable ID) Copy the persistent state (value) corresponding to the given identifier to the given trasient instance. |
Object |
Load(String entityname, serializable ID) If a qualified instance exists, a persistent instance is returned Based on the given entity class and identifier. |
Object |
Load(String entityname, serializable ID, lockmode) If a qualified instance exists, a persistent instance is returned Based on the given entity class, identifier, and specified lock level. |
Void |
Lock(Object object, lockmode) Obtain the specified lock level from a given object. |
Void |
Lock(String entityname, object, lockmode) Obtain the specified lock level from a given object. |
Object |
Merge(Object object) Copy the status of a given object to a persistent object with the same identifier. |
Object |
Merge(String entityname, object) Copy the status of a given object to a persistent object with the same identifier. |
Void |
Persist(Object object) Persists an instance in the Free State (transient. |
Void |
Persist(String entityname, object) Persists an instance in the Free State (transient. |
Void |
Reconnect() Not recommended. Manual reconnection is only applicable when applications provide connections. In this case, you may need to useReconnect (Java. SQL. Connection) . |
Void |
Reconnect(Connection) Reconnect to the specified JDBC connection. |
Void |
Refresh(Object object) Reads the status of a given instance from the database. |
Void |
Refresh(Object object, lockmode) Based on the specifiedLock mode)To re-read the status of a given instance from the database. |
Void |
Replicate(Object object, replicationmode) Uses the current Identifier value to persist the given free state (transient) entity. |
Void |
Replicate(String entityname, object, replicationmode) Uses the current Identifier value to persist the given free state (transient) entity. |
Serializable |
Save(Object object) First, generate an identifier for the given free state (transient) object (according to the configuration) and assign a value, and then make it persistent. |
Serializable |
Save(String entityname, object) First, generate an identifier for the given free state (transient) object (according to the configuration) and assign a value, and then make it persistent. |
Void |
Saveorupdate(Object object) Based on the value of the Identity attribute of the given instance (Note: unsaved-value can be specified. The default value is null .) To determine the executionSave ()OrUpdate ()Operation. |
Void |
Saveorupdate(String entityname, object) Based on the value of the Identity attribute of the given instance (Note: unsaved-value can be specified. The default value is null .) To determine the executionSave ()OrUpdate ()Operation. |
Void |
Setcachemode(Cachemode) Set the refresh submission mode. |
Void |
Setflushmode(Flushmode) Set the refresh submission mode. |
Void |
Setreadonly(Object entity, Boolean readonly) Set an unchanged Persistent Object to read-only mode, or mark a read-only object as a mode that can be modified. |
Void |
Update(Object object) Update the persistent instance based on the ID of the specified detached (idle state) object instance. |
Void |
Update(String entityname, object) Update the persistent instance based on the ID of the specified detached (idle state) object instance. |