Package io.jmix.eclipselink.impl
Class JpaDataStore
java.lang.Object
io.jmix.core.datastore.AbstractDataStore
io.jmix.eclipselink.impl.JpaDataStore
- All Implemented Interfaces:
DataSortingOptions
,DataStore
@Component("eclipselink_JpaDataStore")
@Scope("prototype")
public class JpaDataStore
extends AbstractDataStore
implements DataSortingOptions
INTERNAL.
Implementation of the
DataStore
interface working with a relational database using JPA.-
Nested Class Summary
Nested classes/interfaces inherited from class io.jmix.core.datastore.AbstractDataStore
AbstractDataStore.EntityLoadInfo
-
Field Summary
Modifier and TypeFieldDescriptionprotected AccessManager
protected org.springframework.context.ApplicationContext
protected DbmsSpecifics
protected EntityChangedEventManager
protected EntityEventManager
protected ExtendedEntities
protected FetchPlanRepository
protected FetchPlans
protected org.springframework.beans.factory.ObjectProvider<JpqlQueryBuilder>
static final String
protected EclipselinkPersistenceSupport
protected DataProperties
protected QueryResultsManager
protected QueryTransformerFactory
static final String
protected StoreAwareLocator
protected String
protected static final AtomicLong
Fields inherited from class io.jmix.core.datastore.AbstractDataStore
entityStates, keyValueMapper, listeners, metadata, metadataTools
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
beforeLoadTransactionCommit
(LoadContext<?> context, Collection<Object> entities) protected void
beforeSaveTransactionCommit
(SaveContext context, Collection<Object> savedEntities, Collection<Object> removedEntities) protected void
beforeSaveTransactionRollback
(SaveContext context) protected Object
beginLoadTransaction
(boolean joinTransaction) protected Object
beginSaveTransaction
(boolean joinTransaction) protected void
commitTransaction
(Object transaction) protected long
countAll
(LoadContext<?> context) protected long
countAllValues
(ValueLoadContext context) protected FetchPlan
createFetchPlan
(LoadContext<?> context) protected javax.persistence.Query
createLoadQuery
(javax.persistence.EntityManager em, ValueLoadContext context, boolean count) protected javax.persistence.Query
createQuery
(javax.persistence.EntityManager em, LoadContext<?> context, boolean countQuery) deleteAll
(SaveContext context) protected <E> void
detachEntity
(javax.persistence.EntityManager em, E rootEntity, FetchPlan fetchPlan, boolean loadedOnly) executeQuery
(javax.persistence.Query query, boolean singleResult) getName()
This data store instance name with which it is registered inStores
.protected Pattern
boolean
protected boolean
isSingleResult
(LoadContext<?> context) loadAll
(LoadContext<?> context) loadAllByIdBatches
(LoadContext<?> context, javax.persistence.EntityManager em) loadAllByIds
(LoadContext<?> context, javax.persistence.EntityManager em) loadAllValues
(ValueLoadContext context) protected Object
loadOne
(LoadContext<?> context) protected String
resolveConstraintName
(Matcher matcher) protected void
rollbackTransaction
(Object transaction) Set<?>
save
(SaveContext context) Saves a collection of entity instances.saveAll
(SaveContext context) void
Sets this data store instance name with which it is registered inStores
.boolean
Methods inherited from class io.jmix.core.datastore.AbstractDataStore
checkAndReorderLoadedEntities, copyNonPersistentAttributes, fireEvent, getCount, getCount, getFetchPlanForSave, load, loadAllAfterSave, loadList, loadListByBatches, loadValues, registerInterceptor, setEntityStates, setKeyValueMapper, setMetadata, setMetadataTools
-
Field Details
-
LOAD_TX_PREFIX
- See Also:
-
SAVE_TX_PREFIX
- See Also:
-
properties
-
fetchPlans
-
accessManager
-
queryResultsManager
-
queryTransformerFactory
-
entityChangedEventManager
-
entityEventManager
-
dbmsSpecifics
-
storeAwareLocator
-
applicationContext
@Autowired protected org.springframework.context.ApplicationContext applicationContext -
extendedEntities
-
jpqlQueryBuilderProvider
@Autowired protected org.springframework.beans.factory.ObjectProvider<JpqlQueryBuilder> jpqlQueryBuilderProvider -
persistenceSupport
-
fetchPlanRepository
-
storeName
-
txCount
-
-
Constructor Details
-
JpaDataStore
public JpaDataStore()
-
-
Method Details
-
getName
Description copied from interface:DataStore
This data store instance name with which it is registered inStores
. -
setName
Description copied from interface:DataStore
Sets this data store instance name with which it is registered inStores
. -
loadOne
- Specified by:
loadOne
in classAbstractDataStore
-
loadAll
- Specified by:
loadAll
in classAbstractDataStore
-
loadAllByIds
-
loadAllByIdBatches
protected List<Object> loadAllByIdBatches(LoadContext<?> context, javax.persistence.EntityManager em) -
countAll
- Specified by:
countAll
in classAbstractDataStore
-
save
Description copied from interface:DataStore
Saves a collection of entity instances.- Specified by:
save
in interfaceDataStore
- Overrides:
save
in classAbstractDataStore
- Returns:
- set of saved instances
-
saveAll
- Specified by:
saveAll
in classAbstractDataStore
-
deleteAll
- Specified by:
deleteAll
in classAbstractDataStore
-
loadAllValues
- Specified by:
loadAllValues
in classAbstractDataStore
-
countAllValues
- Specified by:
countAllValues
in classAbstractDataStore
-
beginLoadTransaction
- Specified by:
beginLoadTransaction
in classAbstractDataStore
-
beforeLoadTransactionCommit
- Overrides:
beforeLoadTransactionCommit
in classAbstractDataStore
-
rollbackTransaction
- Specified by:
rollbackTransaction
in classAbstractDataStore
-
commitTransaction
- Specified by:
commitTransaction
in classAbstractDataStore
-
beginSaveTransaction
- Specified by:
beginSaveTransaction
in classAbstractDataStore
-
beforeSaveTransactionCommit
protected void beforeSaveTransactionCommit(SaveContext context, Collection<Object> savedEntities, Collection<Object> removedEntities) - Overrides:
beforeSaveTransactionCommit
in classAbstractDataStore
-
beforeSaveTransactionRollback
- Overrides:
beforeSaveTransactionRollback
in classAbstractDataStore
-
createQuery
protected javax.persistence.Query createQuery(javax.persistence.EntityManager em, LoadContext<?> context, boolean countQuery) -
createLoadQuery
protected javax.persistence.Query createLoadQuery(javax.persistence.EntityManager em, ValueLoadContext context, boolean count) -
createFetchPlan
-
executeQuery
-
detachEntity
protected <E> void detachEntity(javax.persistence.EntityManager em, @Nullable E rootEntity, @Nullable FetchPlan fetchPlan, boolean loadedOnly) -
isSingleResult
- Parameters:
context
- - loading context- Returns:
- false if maxResults=1 and the query is not by ID we should not use getSingleResult() for backward compatibility
-
isNullsLastSorting
public boolean isNullsLastSorting()- Specified by:
isNullsLastSorting
in interfaceDataSortingOptions
- Returns:
- default sort order of null values
-
supportsLobSortingAndFiltering
public boolean supportsLobSortingAndFiltering()- Specified by:
supportsLobSortingAndFiltering
in interfaceDataSortingOptions
- Returns:
- true if the data store supports equality check and sorting for LOB columns
-
getUniqueConstraintViolationPattern
-
resolveConstraintName
-