Class JDBCBrokerFactory
java.lang.Object
org.apache.openjpa.kernel.AbstractBrokerFactory
org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory
- All Implemented Interfaces:
Serializable, BrokerFactory, Closeable
- Direct Known Subclasses:
DistributedJDBCBrokerFactory
BrokerFactory type for use with the JDBC runtime.
- Author:
- Abe White, Marc Prud'hommeaux
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct the factory with the given option settings; however, the factory construction methods are recommended. -
Method Summary
Modifier and TypeMethodDescriptionvoidcreatePersistenceStructure(boolean createSchemas) Creates the database schema and tables required by the persistence unit.voiddropPersistenceStructure(boolean dropSchemas) Drops the database schema and tables managed by the persistence unit.static JDBCBrokerFactorygetInstance(ConfigurationProvider cp, ClassLoader loader) Factory method for obtaining a possibly-pooled factory from properties.Subclasses should override this method to add aPlatformproperty listing the runtime platform, such as:OpenJPA JDBC Edition: Oracle Databaseprotected BrokerImplnewBrokerImpl(String user, String pass) Return a broker configured with the proper settings.static JDBCBrokerFactoryFactory method for constructing a factory from properties.protected StoreManagerReturn a new StoreManager for this runtime.voidThis method is invoked AFTER a BrokerFactory has been instantiated.protected booleansynchronizeMappings(ClassLoader loader) protected booleansynchronizeMappings(ClassLoader loader, JDBCConfiguration conf) protected booleansynchronizeMappings(ClassLoader loader, JDBCConfiguration conf, String action) Synchronize the mappings of the classes listed in the configuration.voidTruncates all rows from tables managed by the persistence unit.voidValidates that the live database schema matches the metadata of the persistence unit.Methods inherited from class AbstractBrokerFactory
addLifecycleListener, addListeners, addTransactionListener, assertOpen, close, configureBroker, createDelegatingStoreManager, findBroker, findTransactionalBroker, getConfiguration, getFactoryInitializationBanner, getOpenBrokers, getPooledFactoryForKey, getPoolKey, getSupportedProperties, getUserObject, isClosed, loadPersistentTypes, lock, makeReadOnly, newBroker, newBroker, newBroker, newBroker, newBroker, newBroker, pool, putUserObject, readResolve, releaseBroker, removeLifecycleListener, removeTransactionListener, setup, toPoolKey, unlock
-
Constructor Details
-
JDBCBrokerFactory
Construct the factory with the given option settings; however, the factory construction methods are recommended.
-
-
Method Details
-
newInstance
Factory method for constructing a factory from properties. Invoked fromBootstrap.newBrokerFactory(). -
getInstance
Factory method for obtaining a possibly-pooled factory from properties. Invoked fromBootstrap.getBrokerFactory(). -
getProperties
Description copied from class:AbstractBrokerFactorySubclasses should override this method to add aPlatformproperty listing the runtime platform, such as:OpenJPA JDBC Edition: Oracle Database- Specified by:
getPropertiesin interfaceBrokerFactory- Overrides:
getPropertiesin classAbstractBrokerFactory
-
postCreationCallback
public void postCreationCallback()Description copied from class:AbstractBrokerFactoryThis method is invoked AFTER a BrokerFactory has been instantiated.- Specified by:
postCreationCallbackin interfaceBrokerFactory- Overrides:
postCreationCallbackin classAbstractBrokerFactory
-
newStoreManager
Description copied from class:AbstractBrokerFactoryReturn a new StoreManager for this runtime. Note that the instance returned here may be wrapped before being passed to theAbstractBrokerFactory.newBroker()method.- Specified by:
newStoreManagerin classAbstractBrokerFactory
-
newBrokerImpl
Description copied from class:AbstractBrokerFactoryReturn a broker configured with the proper settings. By default, this method constructs a new BrokerImpl of the class set for this factory.- Overrides:
newBrokerImplin classAbstractBrokerFactory
-
createPersistenceStructure
public void createPersistenceStructure(boolean createSchemas) Description copied from interface:BrokerFactoryCreates the database schema and tables required by the persistence unit. Implements thecreateaction of the JPA 3.2jakarta.persistence.SchemaManagercontract.- Specified by:
createPersistenceStructurein interfaceBrokerFactory- Overrides:
createPersistenceStructurein classAbstractBrokerFactory
-
dropPersistenceStructure
public void dropPersistenceStructure(boolean dropSchemas) Description copied from interface:BrokerFactoryDrops the database schema and tables managed by the persistence unit. Implements thedropaction of the JPA 3.2jakarta.persistence.SchemaManagercontract.- Specified by:
dropPersistenceStructurein interfaceBrokerFactory- Overrides:
dropPersistenceStructurein classAbstractBrokerFactory
-
validatePersistenceStructure
Description copied from interface:BrokerFactoryValidates that the live database schema matches the metadata of the persistence unit. Implements thevalidateaction of the JPA 3.2jakarta.persistence.SchemaManagercontract.- Specified by:
validatePersistenceStructurein interfaceBrokerFactory- Overrides:
validatePersistenceStructurein classAbstractBrokerFactory- Throws:
Exception
-
truncateData
public void truncateData()Description copied from interface:BrokerFactoryTruncates all rows from tables managed by the persistence unit. Implements thetruncateaction of the JPA 3.2jakarta.persistence.SchemaManagercontract.- Specified by:
truncateDatain interfaceBrokerFactory- Overrides:
truncateDatain classAbstractBrokerFactory
-
synchronizeMappings
-
synchronizeMappings
Synchronize the mappings of the classes listed in the configuration. -
synchronizeMappings
-