[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2860?page=c...
]
Steve Ebersole commented on HHH-2860:
-------------------------------------
This is implemented in a builder style. There are 2 ways.
First from a {{SessionFactory}} there is a contract {{SessionBuilder}} accessible by
calling {{SessionFactory#withOptions()}}. {{SessionBuilder}} exposes a number of methods
to customize how a session is to be built as well as a method {{openSession()}} to then
build the session. For example:
{code}
Session session = sessionFactory.withOptions()
.connection( someConnection )
.interceptor( yourInterceptor )
.openSession();
{code}
Second from {{Session}} there is a contract {{SharedSessonBuilder}} accessible by calling
{{Session#sessionWithOptions()}}. {{SharedSessonBuilder}} extends {{SessionBuilder}} and
exposes a additional number of methods for customizing how a session is to be built based
on the state of the starting session. For example:
{code}
Session session = session.sessionWithOptions()
.interceptor( yourInterceptor )
.transactionContext()
.openSession();
{code}
Consolidate Session creation options/parameters
-----------------------------------------------
Key: HHH-2860
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2860
Project: Hibernate Core
Issue Type: Improvement
Components: core
Reporter: Steve Ebersole
Assignee: Steve Ebersole
Fix For: 4.0.0.Alpha2
This is a partial follow-on for the deprecation of Session#connection()
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira