📄 session.html
字号:
<TD><CODE><B><A HREF="../../org/hibernate/Session.html#getStatistics()">getStatistics</A></B>()</CODE>
<BR>
Get the statistics for this session.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../org/hibernate/Transaction.html" title="interface in org.hibernate">Transaction</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../org/hibernate/Session.html#getTransaction()">getTransaction</A></B>()</CODE>
<BR>
Get the <tt>Transaction</tt> instance associated with this session.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../org/hibernate/Session.html#isConnected()">isConnected</A></B>()</CODE>
<BR>
Check if the <tt>Session</tt> is currently connected.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../org/hibernate/Session.html#isDirty()">isDirty</A></B>()</CODE>
<BR>
Does this <tt>Session</tt> contain any changes which must be synchronized with the database? Would any SQL be executed if we flushed this session?</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../org/hibernate/Session.html#isOpen()">isOpen</A></B>()</CODE>
<BR>
Check if the <tt>Session</tt> is still open.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../org/hibernate/Session.html#load(java.lang.Class, java.io.Serializable)">load</A></B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Class.html" title="class or interface in java.lang">Class</A> theClass, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/io/Serializable.html" title="class or interface in java.io">Serializable</A> id)</CODE>
<BR>
Return the persistent instance of the given entity class with the given identifier, assuming that the instance exists.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../org/hibernate/Session.html#load(java.lang.Class, java.io.Serializable, org.hibernate.LockMode)">load</A></B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Class.html" title="class or interface in java.lang">Class</A> theClass, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/io/Serializable.html" title="class or interface in java.io">Serializable</A> id, <A HREF="../../org/hibernate/LockMode.html" title="class in org.hibernate">LockMode</A> lockMode)</CODE>
<BR>
Return the persistent instance of the given entity class with the given identifier, obtaining the specified lock mode, assuming the instance exists.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../org/hibernate/Session.html#load(java.lang.Object, java.io.Serializable)">load</A></B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> object, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/io/Serializable.html" title="class or interface in java.io">Serializable</A> id)</CODE>
<BR>
Read the persistent state associated with the given identifier into the given transient instance.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../org/hibernate/Session.html#load(java.lang.String, java.io.Serializable)">load</A></B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> entityName, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/io/Serializable.html" title="class or interface in java.io">Serializable</A> id)</CODE>
<BR>
Return the persistent instance of the given entity class with the given identifier, assuming that the instance exists.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../org/hibernate/Session.html#load(java.lang.String, java.io.Serializable, org.hibernate.LockMode)">load</A></B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> entityName, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/io/Serializable.html" title="class or interface in java.io">Serializable</A> id, <A HREF="../../org/hibernate/LockMode.html" title="class in org.hibernate">LockMode</A> lockMode)</CODE>
<BR>
Return the persistent instance of the given entity class with the given identifier, obtaining the specified lock mode, assuming the instance exists.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../org/hibernate/Session.html#lock(java.lang.Object, org.hibernate.LockMode)">lock</A></B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> object, <A HREF="../../org/hibernate/LockMode.html" title="class in org.hibernate">LockMode</A> lockMode)</CODE>
<BR>
Obtain the specified lock level upon the given object.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../org/hibernate/Session.html#lock(java.lang.String, java.lang.Object, org.hibernate.LockMode)">lock</A></B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> entityName, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> object, <A HREF="../../org/hibernate/LockMode.html" title="class in org.hibernate">LockMode</A> lockMode)</CODE>
<BR>
Obtain the specified lock level upon the given object.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../org/hibernate/Session.html#merge(java.lang.Object)">merge</A></B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> object)</CODE>
<BR>
Copy the state of the given object onto the persistent object with the same identifier.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../org/hibernate/Session.html#merge(java.lang.String, java.lang.Object)">merge</A></B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> entityName, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> object)</CODE>
<BR>
Copy the state of the given object onto the persistent object with the same identifier.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../org/hibernate/Session.html#persist(java.lang.Object)">persist</A></B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> object)</CODE>
<BR>
Make a transient instance persistent.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../org/hibernate/Session.html#persist(java.lang.String, java.lang.Object)">persist</A></B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> entityName, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> object)</CODE>
<BR>
Make a transient instance persistent.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../org/hibernate/Session.html#reconnect()">reconnect</A></B>()</CODE>
<BR>
<B>Deprecated.</B> <I>Manual reconnection is only needed in the case of application-supplied connections, in which case the <A HREF="../../org/hibernate/Session.html#reconnect(java.sql.Connection)"><CODE>reconnect(java.sql.Connection)</CODE></A> for should be used.</I></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../org/hibernate/Session.html#reconnect(java.sql.Connection)">reconnect</A></B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/sql/Connection.html" title="class or interface in java.sql">Connection</A> connection)</CODE>
<BR>
Reconnect to the given JDBC connection.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../org/hibernate/Session.html#refresh(java.lang.Object)">refresh</A></B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> object)</CODE>
<BR>
Re-read the state of the given instance from the underlying database.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../org/hibernate/Session.html#refresh(java.lang.Object, org.hibernate.LockMode)">refresh</A></B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> object, <A HREF="../../org/hibernate/LockMode.html" title="class in org.hibernate">LockMode</A> lockMode)</CODE>
<BR>
Re-read the state of the given instance from the underlying database, with the given <tt>LockMode</tt>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../org/hibernate/Session.html#replicate(java.lang.Object, org.hibernate.ReplicationMode)">replicate</A></B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> object, <A HREF="../../org/hibernate/ReplicationMode.html" title="class in org.hibernate">ReplicationMode</A> replicationMode)</CODE>
<BR>
Persist the state of the given detached instance, reusing the current identifier value.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../org/hibernate/Session.html#replicate(java.lang.String, java.lang.Object, org.hibernate.ReplicationMode)">replicate</A></B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> entityName, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> object, <A HREF="../../org/hibernate/ReplicationMode.html" title="class in org.hibernate">ReplicationMode</A> replicationMode)</CODE>
<BR>
Persist the state of the given detached instance, reusing the current identifier value.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/io/Serializable.html" title="class or interface in java.io">Serializable</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../org/hibernate/Session.html#save(java.lang.Object)">save</A></B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> object)</CODE>
<BR>
Persist the given transient instance, first assigning a generated identifier.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/io/Serializable.html" title="class or interface in java.io">Serializable</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../org/hibernate/Session.html#save(java.lang.String, java.lang.Object)">save</A></B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> entityName, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> object)</CODE>
<BR>
Persist the given transient instance, first assigning a generated identifier.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../org/hibernate/Session.html#saveOrUpdate(java.lang.Object)">saveOrUpdate</A></B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> object)</CODE>
<BR>
Either <tt>save()</tt> or <tt>update()</tt> the given instance, depending upon the value of its identifier property.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../org/hibernate/Session.html#saveOrUpdate(java.lang.String, java.lang.Object)">saveOrUpdate</A></B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> entityName, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> object)</CODE>
<BR>
Either <tt>save()</tt> or <tt>update()</tt> the given instance, depending upon the value of its identifier property.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -