Interface SessionFactory
- All Known Implementing Classes:
AbstractRoutingSessionFactory,DefaultSessionFactory
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A factory for Apache Cassandra
sessions.
A SessionFactory object is the preferred means of getting a connection. The SessionFactory interface
is implemented by a CqlSession provider.
A SessionFactory object can have properties that can be modified when necessary. For example, if the
CqlSession is moved to a different server, the property for the server can be changed. The benefit is that
because the data source's properties can be changed, any code accessing that SessionFactory does not need to
be changed.- Since:
- 2.0
- Author:
- Mark Paluch
- See Also:
-
CqlSessionSession
-
Method Summary
Modifier and TypeMethodDescriptioncom.datastax.oss.driver.api.core.CqlSessionAttempts to establish aCqlSessionwith the connection infrastructure that thisSessionFactoryobject represents.
-
Method Details
-
getSession
com.datastax.oss.driver.api.core.CqlSession getSession()Attempts to establish aCqlSessionwith the connection infrastructure that thisSessionFactoryobject represents.- Returns:
- a
CqlSessionto Apache Cassandra. - See Also:
-
CqlSession
-