Closed alvachien closed 1 year ago
Actually I cannot reproduce the problem. In the builder the JPAODataDatabaseProcessorFactory
is only used in case no database processor is provided:
public JPAODataSessionContextAccess build() throws ODataException {
try {
if (nameBuilder == null) {
LOGGER.trace("No name-builder provided, use JPADefaultEdmNameBuilder");
nameBuilder = new JPADefaultEdmNameBuilder(namespace);
}
if (packageName == null)
packageName = new String[0];
if (!emf.isPresent() && ds != null && namespace != null)
emf = Optional.ofNullable(JPAEntityManagerFactory.getEntityManagerFactory(namespace, ds));
createEmfWrapper();
if (emf.isPresent() && jpaEdm == null)
jpaEdm = new JPAEdmProvider(emf.get().getMetamodel(), postProcessor, packageName, nameBuilder);
if (databaseProcessor == null) {
LOGGER.trace("No database-processor provided, use JPAODataDatabaseProcessorFactory to create one");
databaseProcessor = new JPAODataDatabaseProcessorFactory().create(ds);
}
if (batchProcessorFactory == null) {
LOGGER.trace("No batch-processor-factory provided, use default factory to create one");
batchProcessorFactory = new JPADefaultBatchProcessorFactory();
}
} catch (SQLException | PersistenceException e) {
throw new ODataJPAFilterException(e, HttpStatusCode.INTERNAL_SERVER_ERROR);
}
return new JPAODataServiceContext(this);
}
Is there one method that is not called?
Thanks for the reply.
But still, my own processor cannot be called with CRUD operations.
Or, could you mind share me some lights which method (via interface JPAODataDatabaseOperations
) can be called?
Thank you.
Many be there is a miss understanding. For the CUD operations an implementation of JPACUDRequestHandler
is needed. An instance is provided via the JPAODataRequestContext
.
The goal of the JPAODataDatabaseProcessor
is to support function that are implemented on the data base.
I close the issue. Feel free to reopen it in case your question is not answered.
Class JPAODataServiceContext has a method: setDatabaseProcessor
It seems that we can set it configuration:
However my local database processor never got caught, even all methods have been implemented. Have to jump into the codes of library, the database processor are created by the factory as below, which have no way for database processor at all.
So, the concept 'Database Processor' is not working or it is not yet finished?
Thank you. Alva