Skip to content

Commit 29c6f11

Browse files
committed
1.27
1 parent ed094aa commit 29c6f11

1 file changed

Lines changed: 23 additions & 46 deletions

File tree

hiberate/126.md

Lines changed: 23 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -37,50 +37,27 @@ Session接口提供多个方法,但这里列出的只有少数重要的方法
3737

3838
| S.N. | 会话的方法和说明 |
3939
| --- | --- |
40-
| 1 | **Transaction beginTransaction()** 
41-
Begin a unit of work and return the associated Transaction object. |
42-
| 2 | **void cancelQuery()** 
43-
Cancel the execution of the current query. |
44-
| 3 | **void clear()** 
45-
Completely clear the session. |
46-
| 4 | **Connection close()** 
47-
End the session by releasing the JDBC connection and cleaning up. |
48-
| 5 | **Criteria createCriteria(Class persistentClass)** 
49-
Create a new Criteria instance, for the given entity class, or a superclass of an entity class. |
50-
| 6 | **Criteria createCriteria(String entityName)** 
51-
Create a new Criteria instance, for the given entity name. |
52-
| 7 | **Serializable getIdentifier(Object object)** 
53-
Return the identifier value of the given entity as associated with this session. |
54-
| 8 | **Query createFilter(Object collection, String queryString)** 
55-
Create a new instance of Query for the given collection and filter string. |
56-
| 9 | **Query createQuery(String queryString)** 
57-
Create a new instance of Query for the given HQL query string. |
58-
| 10 | **SQLQuery createSQLQuery(String queryString)** 
59-
Create a new instance of SQLQuery for the given SQL query string. |
60-
| 11 | **void delete(Object object)** 
61-
Remove a persistent instance from the datastore. |
62-
| 12 | **void delete(String entityName, Object object)** 
63-
Remove a persistent instance from the datastore. |
64-
| 13 | **Session get(String entityName, Serializable id)** 
65-
Return the persistent instance of the given named entity with the given identifier, or null if there is no such persistent instance. |
66-
| 14 | **SessionFactory getSessionFactory()** 
67-
Get the session factory which created this session. |
68-
| 15 | **void refresh(Object object)** 
69-
Re-read the state of the given instance from the underlying database. |
70-
| 16 | **Transaction getTransaction()** 
71-
Get the Transaction instance associated with this session. |
72-
| 17 | **boolean isConnected()** 
73-
Check if the session is currently connected. |
74-
| 18 | **boolean isDirty()** 
75-
Does this session contain any changes which must be synchronized with the database? |
76-
| 19 | **boolean isOpen()** 
77-
Check if the session is still open. |
78-
| 20 | **Serializable save(Object object)** 
79-
Persist the given transient instance, first assigning a generated identifier. |
80-
| 21 | **void saveOrUpdate(Object object)** 
81-
Either save(Object) or update(Object) the given instance. |
82-
| 22 | **void update(Object object)** 
83-
Update the persistent instance with the identifier of the given detached instance. |
84-
| 23 | **void update(String entityName, Object object)** 
85-
Update the persistent instance with the identifier of the given detached instance. |
40+
| 1 | **Transaction beginTransaction()** Begin a unit of work and return the associated Transaction object. |
41+
| 2 | **void cancelQuery()** Cancel the execution of the current query. |
42+
| 3 | **void clear()** Completely clear the session. |
43+
| 4 | **Connection close()** End the session by releasing the JDBC connection and cleaning up. |
44+
| 5 | **Criteria createCriteria(Class persistentClass)** Create a new Criteria instance, for the given entity class, or a superclass of an entity class. |
45+
| 6 | **Criteria createCriteria(String entityName)** Create a new Criteria instance, for the given entity name. |
46+
| 7 | **Serializable getIdentifier(Object object)** Return the identifier value of the given entity as associated with this session. |
47+
| 8 | **Query createFilter(Object collection, String queryString)** Create a new instance of Query for the given collection and filter string. |
48+
| 9 | **Query createQuery(String queryString)** Create a new instance of Query for the given HQL query string. |
49+
| 10 | **SQLQuery createSQLQuery(String queryString)** Create a new instance of SQLQuery for the given SQL query string. |
50+
| 11 | **void delete(Object object)** Remove a persistent instance from the datastore. |
51+
| 12 | **void delete(String entityName, Object object)** Remove a persistent instance from the datastore. |
52+
| 13 | **Session get(String entityName, Serializable id)** Return the persistent instance of the given named entity with the given identifier, or null if there is no such persistent instance. |
53+
| 14 | **SessionFactory getSessionFactory()** Get the session factory which created this session. |
54+
| 15 | **void refresh(Object object)** Re-read the state of the given instance from the underlying database. |
55+
| 16 | **Transaction getTransaction()** Get the Transaction instance associated with this session. |
56+
| 17 | **boolean isConnected()** Check if the session is currently connected. |
57+
| 18 | **boolean isDirty()** Does this session contain any changes which must be synchronized with the database? |
58+
| 19 | **boolean isOpen()** Check if the session is still open. |
59+
| 20 | **Serializable save(Object object)** Persist the given transient instance, first assigning a generated identifier. |
60+
| 21 | **void saveOrUpdate(Object object)** Either save(Object) or update(Object) the given instance. |
61+
| 22 | **void update(Object object)** Update the persistent instance with the identifier of the given detached instance. |
62+
| 23 | **void update(String entityName, Object object)** Update the persistent instance with the identifier of the given detached instance. |
8663

0 commit comments

Comments
 (0)