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

📄 sessionfactory.html

📁 非常好的 Hibernate中文API ,供各位开发参考
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../org/hibernate/classic/Session.html" title="interface in org.hibernate.classic">Session</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../org/hibernate/SessionFactory.html#openSession(java.sql.Connection, org.hibernate.Interceptor)">openSession</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>&nbsp;connection,            <A HREF="../../org/hibernate/Interceptor.html" title="interface in org.hibernate">Interceptor</A>&nbsp;interceptor)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Open a <tt>Session</tt> on the given connection, specifying an interceptor.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../org/hibernate/classic/Session.html" title="interface in org.hibernate.classic">Session</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../org/hibernate/SessionFactory.html#openSession(org.hibernate.Interceptor)">openSession</A></B>(<A HREF="../../org/hibernate/Interceptor.html" title="interface in org.hibernate">Interceptor</A>&nbsp;interceptor)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Create database connection and open a <tt>Session</tt> on it, specifying an interceptor.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../org/hibernate/StatelessSession.html" title="interface in org.hibernate">StatelessSession</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../org/hibernate/SessionFactory.html#openStatelessSession()">openStatelessSession</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get a new stateless session.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../org/hibernate/StatelessSession.html" title="interface in org.hibernate">StatelessSession</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../org/hibernate/SessionFactory.html#openStatelessSession(java.sql.Connection)">openStatelessSession</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>&nbsp;connection)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get a new stateless session for the given JDBC connection.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_javax.naming.Referenceable"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from interface javax.naming.<A HREF="http://java.sun.com/j2se/1.3/docs/api/javax/naming/Referenceable.html" title="class or interface in javax.naming">Referenceable</A></B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/javax/naming/Referenceable.html#getReference()" title="class or interface in javax.naming">getReference</A></CODE></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="openSession(java.sql.Connection)"><!-- --></A><H3>
openSession</H3>
<PRE>
public <A HREF="../../org/hibernate/classic/Session.html" title="interface in org.hibernate.classic">Session</A> <B>openSession</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>&nbsp;connection)</PRE>
<DL>
<DD>Open a <tt>Session</tt> on the given connection. <p> Note that the second-level cache will be disabled if you supply a JDBC connection. Hibernate will not be able to track any statements you might have executed in the same transaction. Consider implementing your own <tt>ConnectionProvider</tt>.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>connection</CODE> - a connection provided by the application.<DT><B>Returns:</B><DD>Session</DL>
</DD>
</DL>
<HR>

<A NAME="openSession(org.hibernate.Interceptor)"><!-- --></A><H3>
openSession</H3>
<PRE>
public <A HREF="../../org/hibernate/classic/Session.html" title="interface in org.hibernate.classic">Session</A> <B>openSession</B>(<A HREF="../../org/hibernate/Interceptor.html" title="interface in org.hibernate">Interceptor</A>&nbsp;interceptor)                    throws <A HREF="../../org/hibernate/HibernateException.html" title="class in org.hibernate">HibernateException</A></PRE>
<DL>
<DD>Create database connection and open a <tt>Session</tt> on it, specifying an interceptor.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>interceptor</CODE> - a session-scoped interceptor<DT><B>Returns:</B><DD>Session<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="openSession(java.sql.Connection, org.hibernate.Interceptor)"><!-- --></A><H3>
openSession</H3>
<PRE>
public <A HREF="../../org/hibernate/classic/Session.html" title="interface in org.hibernate.classic">Session</A> <B>openSession</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>&nbsp;connection,                           <A HREF="../../org/hibernate/Interceptor.html" title="interface in org.hibernate">Interceptor</A>&nbsp;interceptor)</PRE>
<DL>
<DD>Open a <tt>Session</tt> on the given connection, specifying an interceptor. <p> Note that the second-level cache will be disabled if you supply a JDBC connection. Hibernate will not be able to track any statements you might have executed in the same transaction. Consider implementing your own <tt>ConnectionProvider</tt>.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>connection</CODE> - a connection provided by the application.<DD><CODE>interceptor</CODE> - a session-scoped interceptor<DT><B>Returns:</B><DD>Session</DL>
</DD>
</DL>
<HR>

<A NAME="openSession()"><!-- --></A><H3>
openSession</H3>
<PRE>
public <A HREF="../../org/hibernate/classic/Session.html" title="interface in org.hibernate.classic">Session</A> <B>openSession</B>()                    throws <A HREF="../../org/hibernate/HibernateException.html" title="class in org.hibernate">HibernateException</A></PRE>
<DL>
<DD>Create database connection and open a <tt>Session</tt> on it.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>Session<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="getCurrentSession()"><!-- --></A><H3>
getCurrentSession</H3>
<PRE>
public <A HREF="../../org/hibernate/classic/Session.html" title="interface in org.hibernate.classic">Session</A> <B>getCurrentSession</B>()                          throws <A HREF="../../org/hibernate/HibernateException.html" title="class in org.hibernate">HibernateException</A></PRE>
<DL>
<DD>Obtains the current session.  The definition of what exactly "current" means controlled by the <A HREF="../../org/hibernate/context/CurrentSessionContext.html" title="interface in org.hibernate.context"><CODE>CurrentSessionContext</CODE></A> impl configured for use. <p/> Note that for backwards compatibility, if a <A HREF="../../org/hibernate/context/CurrentSessionContext.html" title="interface in org.hibernate.context"><CODE>CurrentSessionContext</CODE></A> is not configured but a JTA <A HREF="../../org/hibernate/transaction/TransactionManagerLookup.html" title="interface in org.hibernate.transaction"><CODE>TransactionManagerLookup</CODE></A> is configured this will default to the <A HREF="../../org/hibernate/context/JTASessionContext.html" title="class in org.hibernate.context"><CODE>JTASessionContext</CODE></A> impl.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>The current session.<DT><B>Throws:</B><DD><CODE><A HREF="../../org/hibernate/HibernateException.html" title="class in org.hibernate">HibernateException</A></CODE> - Indicates an issue locating a suitable current session.</DL>
</DD>
</DL>
<HR>

<A NAME="getClassMetadata(java.lang.Class)"><!-- --></A><H3>
getClassMetadata</H3>
<PRE>
public <A HREF="../../org/hibernate/metadata/ClassMetadata.html" title="interface in org.hibernate.metadata">ClassMetadata</A> <B>getClassMetadata</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>&nbsp;persistentClass)                               throws <A HREF="../../org/hibernate/HibernateException.html" title="class in org.hibernate">HibernateException</A></PRE>
<DL>
<DD>Get the <tt>ClassMetadata</tt> associated with the given entity class
<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><DT><B>See Also:</B><DD><A HREF="../../org/hibernate/metadata/ClassMetadata.html" title="interface in org.hibernate.metadata"><CODE>ClassMetadata</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getClassMetadata(java.lang.String)"><!-- --></A><H3>
getClassMetadata</H3>
<PRE>
public <A HREF="../../org/hibernate/metadata/ClassMetadata.html" title="interface in org.hibernate.metadata">ClassMetadata</A> <B>getClassMetadata</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)                               throws <A HREF="../../org/hibernate/HibernateException.html" title="class in org.hibernate">HibernateException</A></PRE>
<DL>
<DD>Get the <tt>ClassMetadata</tt> associated with the given entity name
<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><DT><B>Since:</B></DT>  <DD>3.0</DD><DT><B>See Also:</B><DD><A HREF="../../org/hibernate/metadata/ClassMetadata.html" title="interface in org.hibernate.metadata"><CODE>ClassMetadata</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getCollectionMetadata(java.lang.String)"><!-- --></A><H3>
getCollectionMetadata</H3>
<PRE>
public <A HREF="../../org/hibernate/metadata/CollectionMetadata.html" title="interface in org.hibernate.metadata">CollectionMetadata</A> <B>getCollectionMetadata</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;roleName)                                         throws <A HREF="../../org/hibernate/HibernateException.html" title="class in org.hibernate">HibernateException</A></PRE>
<DL>
<DD>Get the <tt>CollectionMetadata</tt> associated with the named collection role
<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><DT><B>See Also:</B><DD><A HREF="../../org/hibernate/metadata/CollectionMetadata.html" title="interface in org.hibernate.metadata"><CODE>CollectionMetadata</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getAllClassMetadata()"><!-- --></A><H3>
getAllClassMetadata</H3>
<PRE>
public <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/Map.html" title="class or interface in java.util">Map</A> <B>getAllClassMetadata</B>()                        throws <A HREF="../../org/hibernate/HibernateException.html" title="class in org.hibernate">HibernateException</A></PRE>
<DL>
<DD>Get all <tt>ClassMetadata</tt> as a <tt>Map</tt> from entityname <tt>String</tt> to metadata object
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>a map from <tt>String</tt> an entity name to <tt>ClassMetaData</tt><DT><B>Throws:</B><DD><CODE><A HREF="../../org/hibernate/HibernateException.html" title="class in org.hibernate">HibernateException</A></CODE><DT><B>Since:</B></DT>  <DD>3.0 changed key from <tt>Class</tt> to <tt>String</tt></DD><DT><B>See Also:</B><DD><A HREF="../../org/hibernate/metadata/ClassMetadata.html" title="interface in org.hibernate.metadata"><CODE>ClassMetadata</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getAllCollectionMetadata()"><!-- --></A><H3>
getAllCollectionMetadata</H3>
<PRE>
public <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/Map.html" title="class or interface in java.util">Map</A> <B>getAllCollectionMetadata</B>()                             throws <A HREF="../../org/hibernate/HibernateException.html" title="class in org.hibernate">HibernateException</A></PRE>
<DL>
<DD>Get all <tt>CollectionMetadata</tt> as a <tt>Map</tt> from role name to metadata object
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>a map from <tt>String</tt> to <tt>CollectionMetadata</tt><DT><B>Throws:</B><DD><CODE><A HREF="../../org/hibernate/HibernateException.html" title="class in org.hibernate">HibernateException</A></CODE><DT><B>See Also:</B><DD><A HREF="../../org/hibernate/metadata/CollectionMetadata.html" title="interface in org.hibernate.metadata"><CODE>CollectionMetadata</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getStatistics()"><!-- --></A><H3>
getStatistics</H3>
<PRE>
public <A HREF="../../org/hibernate/stat/Statistics.html" title="interface in org.hibernate.stat">Statistics</A> <B>getStatistics</B>()</PRE>
<DL>
<DD>Get the statistics for this session factory
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="close()"><!-- --></A><H3>
close</H3>
<PRE>
public void <B>close</B>()           throws <A HREF="../../org/hibernate/HibernateException.html" title="class in org.hibernate">HibernateException</A></PRE>
<DL>
<DD>Destroy this <tt>SessionFactory</tt> and release all resources (caches, connection pools, etc). It is the responsibility of the application to ensure that there are no open <tt>Session</tt>s before calling <tt>close()</tt>.
<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>

⌨️ 快捷键说明

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