Package org.datanucleus.api.jdo
Class JDOConnectionImpl
java.lang.Object
org.datanucleus.api.jdo.JDOConnectionImpl
- All Implemented Interfaces:
javax.jdo.datastore.JDOConnection
- Direct Known Subclasses:
JDOConnectionJDBCImpl
Implementation of a generic JDO connection for non-RDBMS datastores.
Takes the NucleusConnection as input, providing all behaviour and closure of underlying connections.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.datanucleus.store.NucleusConnection
Underlying NucleusConnection providing the connection. -
Constructor Summary
ConstructorsConstructorDescriptionJDOConnectionImpl
(org.datanucleus.store.NucleusConnection nconn) Constructor taking the underlying NucleusConnection that provides the datastore access. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Method to close the connection.Accessor for the native connection for this datastore.protected void
Throw a JDOUserException that the connection is no longer available.protected void
throwExceptionUnsupportedOperation
(String methodName) Convenience method that throws a JDOUserException that the specified method name is not supported.
-
Field Details
-
nucConn
protected org.datanucleus.store.NucleusConnection nucConnUnderlying NucleusConnection providing the connection.
-
-
Constructor Details
-
JDOConnectionImpl
public JDOConnectionImpl(org.datanucleus.store.NucleusConnection nconn) Constructor taking the underlying NucleusConnection that provides the datastore access.- Parameters:
nconn
- Underlying connection
-
-
Method Details
-
close
public void close()Method to close the connection.- Specified by:
close
in interfacejavax.jdo.datastore.JDOConnection
-
getNativeConnection
Accessor for the native connection for this datastore. For RDBMS this would be a java.sql.Connection, for Cassandra a Session etc.- Specified by:
getNativeConnection
in interfacejavax.jdo.datastore.JDOConnection
- Returns:
- The native connection
-
throwExceptionNotAvailable
protected void throwExceptionNotAvailable()Throw a JDOUserException that the connection is no longer available. -
throwExceptionUnsupportedOperation
Convenience method that throws a JDOUserException that the specified method name is not supported.- Parameters:
methodName
- Name of the method
-