public enum PersistenceProvider extends Enum<PersistenceProvider> implements QueryExtractor, ProxyIdAccessor
| Enum Constant and Description |
|---|
ECLIPSELINK
EclipseLink persistence provider.
|
GENERIC_JPA
Unknown special provider.
|
HIBERNATE
Hibernate persistence provider.
|
OPEN_JPA
OpenJpa persistence provider.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canExtractQuery()
Returns whether the extractor is able to extract the original query string from a given
Query. |
CloseableIterator<Object> |
executeQueryWithResultStream(javax.persistence.Query jpaQuery) |
static PersistenceProvider |
fromEntityManager(javax.persistence.EntityManager em)
Determines the
PersistenceProvider from the given EntityManager. |
static PersistenceProvider |
fromMetamodel(javax.persistence.metamodel.Metamodel metamodel)
Determines the
PersistenceProvider from the given Metamodel. |
String |
getCountQueryPlaceholder()
Returns the placeholder to be used for simple count queries.
|
<T> Collection<T> |
potentiallyConvertEmptyCollection(Collection<T> collection)
Potentially converts an empty collection to the appropriate representation of this
PersistenceProvider,
since some JPA providers cannot correctly handle empty collections. |
static PersistenceProvider |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static PersistenceProvider[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOfextractQueryStringgetIdentifierFrom, shouldUseAccessorForpublic static final PersistenceProvider HIBERNATE
Since Hibernate 4.3 the location of the HibernateEntityManager moved to the org.hibernate.jpa package. In order to
support both locations we interpret both classnames as a Hibernate PersistenceProvider.
public static final PersistenceProvider ECLIPSELINK
public static final PersistenceProvider OPEN_JPA
public static final PersistenceProvider GENERIC_JPA
public static PersistenceProvider[] values()
for (PersistenceProvider c : PersistenceProvider.values()) System.out.println(c);
public static PersistenceProvider valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic static PersistenceProvider fromEntityManager(javax.persistence.EntityManager em)
PersistenceProvider from the given EntityManager. If no special one can be
determined GENERIC_JPA will be returned.em - must not be null.public static PersistenceProvider fromMetamodel(javax.persistence.metamodel.Metamodel metamodel)
PersistenceProvider from the given Metamodel. If no special one can be determined
GENERIC_JPA will be returned.metamodel - must not be null.public boolean canExtractQuery()
QueryExtractorQuery.canExtractQuery in interface QueryExtractorpublic String getCountQueryPlaceholder()
*.public <T> Collection<T> potentiallyConvertEmptyCollection(Collection<T> collection)
PersistenceProvider,
since some JPA providers cannot correctly handle empty collections.collection - public CloseableIterator<Object> executeQueryWithResultStream(javax.persistence.Query jpaQuery)
Copyright © 2011–2019 Pivotal Software, Inc.. All rights reserved.