⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 session.html

📁 非常好的 Hibernate中文API ,供各位开发参考
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../org/hibernate/Session.html#setCacheMode(org.hibernate.CacheMode)">setCacheMode</A></B>(<A HREF="../../org/hibernate/CacheMode.html" title="class in org.hibernate">CacheMode</A>&nbsp;cacheMode)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set the cache mode.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../org/hibernate/Session.html#setFlushMode(org.hibernate.FlushMode)">setFlushMode</A></B>(<A HREF="../../org/hibernate/FlushMode.html" title="class in org.hibernate">FlushMode</A>&nbsp;flushMode)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set the flush mode.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../org/hibernate/Session.html#setReadOnly(java.lang.Object, boolean)">setReadOnly</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>&nbsp;entity,            boolean&nbsp;readOnly)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set an unmodified persistent object to read only mode, or a read only object to modifiable mode.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../org/hibernate/Session.html#update(java.lang.Object)">update</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>&nbsp;object)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Update the persistent instance with the identifier of the given detached instance.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../org/hibernate/Session.html#update(java.lang.String, java.lang.Object)">update</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>&nbsp;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>&nbsp;object)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Update the persistent instance with the identifier of the given detached instance.</TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ============ FIELD DETAIL =========== -->


<!-- ========= CONSTRUCTOR DETAIL ======== -->


<!-- ============ METHOD DETAIL ========== -->

<A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>

<A NAME="getEntityMode()"><!-- --></A><H3>
getEntityMode</H3>
<PRE>
public <A HREF="../../org/hibernate/EntityMode.html" title="class in org.hibernate">EntityMode</A> <B>getEntityMode</B>()</PRE>
<DL>
<DD>Retrieve the entity mode in effect for this session.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>The entity mode for this session.</DL>
</DD>
</DL>
<HR>

<A NAME="getSession(org.hibernate.EntityMode)"><!-- --></A><H3>
getSession</H3>
<PRE>
public <A HREF="../../org/hibernate/Session.html" title="interface in org.hibernate">Session</A> <B>getSession</B>(<A HREF="../../org/hibernate/EntityMode.html" title="class in org.hibernate">EntityMode</A>&nbsp;entityMode)</PRE>
<DL>
<DD>Starts a new Session with the given entity mode in effect. This secondary Session inherits the connection, transaction, and other context information from the primary Session. It doesn't need to be flushed or closed by the developer.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>entityMode</CODE> - The entity mode to use for the new session.<DT><B>Returns:</B><DD>The new session</DL>
</DD>
</DL>
<HR>

<A NAME="flush()"><!-- --></A><H3>
flush</H3>
<PRE>
public void <B>flush</B>()           throws <A HREF="../../org/hibernate/HibernateException.html" title="class in org.hibernate">HibernateException</A></PRE>
<DL>
<DD>Force the <tt>Session</tt> to flush. Must be called at the end of a unit of work, before commiting the transaction and closing the session (<tt>Transaction.commit()</tt> calls this method). <i>Flushing</i> is the process of synchronising the underlying persistent store with persistable state held in memory.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Throws:</B><DD><CODE><A HREF="../../org/hibernate/HibernateException.html" title="class in org.hibernate">HibernateException</A></CODE></DL>
</DD>
</DL>
<HR>

<A NAME="setFlushMode(org.hibernate.FlushMode)"><!-- --></A><H3>
setFlushMode</H3>
<PRE>
public void <B>setFlushMode</B>(<A HREF="../../org/hibernate/FlushMode.html" title="class in org.hibernate">FlushMode</A>&nbsp;flushMode)</PRE>
<DL>
<DD>Set the flush mode. The flush mode determines at which points Hibernate automatically flushes the session. For a readonly session, it is reasonable to set the flush mode to <tt>FlushMode.NEVER</tt> at the start of the session (in order to achieve some extra performance).
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>flushMode</CODE> - the FlushMode<DT><B>See Also:</B><DD><A HREF="../../org/hibernate/FlushMode.html" title="class in org.hibernate"><CODE>FlushMode</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getFlushMode()"><!-- --></A><H3>
getFlushMode</H3>
<PRE>
public <A HREF="../../org/hibernate/FlushMode.html" title="class in org.hibernate">FlushMode</A> <B>getFlushMode</B>()</PRE>
<DL>
<DD>Get the current flush mode.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>FlushMode</DL>
</DD>
</DL>
<HR>

<A NAME="setCacheMode(org.hibernate.CacheMode)"><!-- --></A><H3>
setCacheMode</H3>
<PRE>
public void <B>setCacheMode</B>(<A HREF="../../org/hibernate/CacheMode.html" title="class in org.hibernate">CacheMode</A>&nbsp;cacheMode)</PRE>
<DL>
<DD>Set the cache mode.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="getCacheMode()"><!-- --></A><H3>
getCacheMode</H3>
<PRE>
public <A HREF="../../org/hibernate/CacheMode.html" title="class in org.hibernate">CacheMode</A> <B>getCacheMode</B>()</PRE>
<DL>
<DD>Get the current cache mode.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="getSessionFactory()"><!-- --></A><H3>
getSessionFactory</H3>
<PRE>
public <A HREF="../../org/hibernate/SessionFactory.html" title="interface in org.hibernate">SessionFactory</A> <B>getSessionFactory</B>()</PRE>
<DL>
<DD>Get the <tt>SessionFactory</tt> that created this instance.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>See Also:</B><DD><A HREF="../../org/hibernate/SessionFactory.html" title="interface in org.hibernate"><CODE>SessionFactory</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="connection()"><!-- --></A><H3>
connection</H3>
<PRE>
public <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/sql/Connection.html" title="class or interface in java.sql">Connection</A> <B>connection</B>()                      throws <A HREF="../../org/hibernate/HibernateException.html" title="class in org.hibernate">HibernateException</A></PRE>
<DL>
<DD>Get the JDBC connection of this Session.<br> <br>  If the session is using aggressive collection release (as in a CMT environment), it is the application's responsibility to close the connection returned by this call. Otherwise, the application should not close the connection.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>the JDBC connection in use by the <tt>Session</tt><DT><B>Throws:</B><DD><CODE><A HREF="../../org/hibernate/HibernateException.html" title="class in org.hibernate">HibernateException</A></CODE> - if the <tt>Session</tt> is disconnected</DL>
</DD>
</DL>
<HR>

<A NAME="close()"><!-- --></A><H3>
close</H3>
<PRE>
public <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/sql/Connection.html" title="class or interface in java.sql">Connection</A> <B>close</B>()                 throws <A HREF="../../org/hibernate/HibernateException.html" title="class in org.hibernate">HibernateException</A></PRE>
<DL>
<DD>End the <tt>Session</tt> by disconnecting from the JDBC connection and cleaning up. It is not strictly necessary to <tt>close()</tt> the

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -