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.
|
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.
|
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, valueOf
extractQueryString
getIdentifierFrom, shouldUseAccessorFor
public 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 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 String getCountQueryPlaceholder()
x
.null
.public boolean canExtractQuery()
QueryExtractor
Query
.canExtractQuery
in interface QueryExtractor
public CloseableIterator<Object> executeQueryWithResultStream(javax.persistence.Query jpaQuery)
Copyright © 2011–2020 Pivotal Software, Inc.. All rights reserved.