📄 session.html
字号:
<tt>Session</tt> but you must at least <tt>disconnect()</tt> it.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>the connection provided by the application or <tt>null</tt><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="cancelQuery()"><!-- --></A><H3>
cancelQuery</H3>
<PRE>
public void <B>cancelQuery</B>() throws <A HREF="../../org/hibernate/HibernateException.html" title="class in org.hibernate">HibernateException</A></PRE>
<DL>
<DD>Cancel execution of the current query. May be called from one thread to stop execution of a query in another thread. Use with care!
<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="isOpen()"><!-- --></A><H3>
isOpen</H3>
<PRE>
public boolean <B>isOpen</B>()</PRE>
<DL>
<DD>Check if the <tt>Session</tt> is still open.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>boolean</DL>
</DD>
</DL>
<HR>
<A NAME="isConnected()"><!-- --></A><H3>
isConnected</H3>
<PRE>
public boolean <B>isConnected</B>()</PRE>
<DL>
<DD>Check if the <tt>Session</tt> is currently connected.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>boolean</DL>
</DD>
</DL>
<HR>
<A NAME="isDirty()"><!-- --></A><H3>
isDirty</H3>
<PRE>
public boolean <B>isDirty</B>() throws <A HREF="../../org/hibernate/HibernateException.html" title="class in org.hibernate">HibernateException</A></PRE>
<DL>
<DD>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?
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>boolean<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="getIdentifier(java.lang.Object)"><!-- --></A><H3>
getIdentifier</H3>
<PRE>
public <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/io/Serializable.html" title="class or interface in java.io">Serializable</A> <B>getIdentifier</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) throws <A HREF="../../org/hibernate/HibernateException.html" title="class in org.hibernate">HibernateException</A></PRE>
<DL>
<DD>Return the identifier of an entity instance cached by the <tt>Session</tt>, or throw an exception if the instance is transient or associated with a different <tt>Session</tt>.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>object</CODE> - a persistent instance<DT><B>Returns:</B><DD>the identifier<DT><B>Throws:</B><DD><CODE><A HREF="../../org/hibernate/TransientObjectException.html" title="class in org.hibernate">TransientObjectException</A></CODE> - if the instance is transient or associated with a different session<DD><CODE><A HREF="../../org/hibernate/HibernateException.html" title="class in org.hibernate">HibernateException</A></CODE></DL>
</DD>
</DL>
<HR>
<A NAME="contains(java.lang.Object)"><!-- --></A><H3>
contains</H3>
<PRE>
public boolean <B>contains</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)</PRE>
<DL>
<DD>Check if this instance is associated with this <tt>Session</tt>.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>object</CODE> - an instance of a persistent class<DT><B>Returns:</B><DD>true if the given instance is associated with this <tt>Session</tt></DL>
</DD>
</DL>
<HR>
<A NAME="evict(java.lang.Object)"><!-- --></A><H3>
evict</H3>
<PRE>
public void <B>evict</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) throws <A HREF="../../org/hibernate/HibernateException.html" title="class in org.hibernate">HibernateException</A></PRE>
<DL>
<DD>Remove this instance from the session cache. Changes to the instance will not be synchronized with the database. This operation cascades to associated instances if the association is mapped with <tt>cascade="evict"</tt>.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>object</CODE> - a persistent instance<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="load(java.lang.Class, java.io.Serializable, org.hibernate.LockMode)"><!-- --></A><H3>
load</H3>
<PRE>
public <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> <B>load</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) throws <A HREF="../../org/hibernate/HibernateException.html" title="class in org.hibernate">HibernateException</A></PRE>
<DL>
<DD>Return the persistent instance of the given entity class with the given identifier, obtaining the specified lock mode, assuming the instance exists.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>theClass</CODE> - a persistent class<DD><CODE>id</CODE> - a valid identifier of an existing persistent instance of the class<DD><CODE>lockMode</CODE> - the lock level<DT><B>Returns:</B><DD>the persistent instance or proxy<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="load(java.lang.String, java.io.Serializable, org.hibernate.LockMode)"><!-- --></A><H3>
load</H3>
<PRE>
public <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> <B>load</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) throws <A HREF="../../org/hibernate/HibernateException.html" title="class in org.hibernate">HibernateException</A></PRE>
<DL>
<DD>Return the persistent instance of the given entity class with the given identifier, obtaining the specified lock mode, assuming the instance exists.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>entityName</CODE> - a persistent class<DD><CODE>id</CODE> - a valid identifier of an existing persistent instance of the class<DD><CODE>lockMode</CODE> - the lock level<DT><B>Returns:</B><DD>the persistent instance or proxy<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="load(java.lang.Class, java.io.Serializable)"><!-- --></A><H3>
load</H3>
<PRE>
public <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> <B>load</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) throws <A HREF="../../org/hibernate/HibernateException.html" title="class in org.hibernate">HibernateException</A></PRE>
<DL>
<DD>Return the persistent instance of the given entity class with the given identifier, assuming that the instance exists. This method might return a proxied instance that is initialized on-demand, when a non-identifier method is accessed. <br><br> You should not use this method to determine if an instance exists (use <tt>get()</tt> instead). Use this only to retrieve an instance that you assume exists, where non-existence would be an actual error.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>theClass</CODE> - a persistent class<DD><CODE>id</CODE> - a valid identifier of an existing persistent instance of the class<DT><B>Returns:</B><DD>the persistent instance or proxy<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="load(java.lang.String, java.io.Serializable)"><!-- --></A><H3>
load</H3>
<PRE>
public <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> <B>load</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) throws <A HREF="../../org/hibernate/HibernateException.html" title="class in org.hibernate">HibernateException</A></PRE>
<DL>
<DD>Return the persistent instance of the given entity class with the given identifier, assuming that the instance exists. This method might return a proxied instance that is initialized on-demand, when a non-identifier method is accessed. <br><br> You should not use this method to determine if an instance exists (use <tt>get()</tt> instead). Use this only to retrieve an instance that you assume exists, where non-existence
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -