Spring Data Jpa

org.springframework.data.jpa.repository.support
Enum PersistenceProvider

java.lang.Object
  extended by java.lang.Enum<PersistenceProvider>
      extended by org.springframework.data.jpa.repository.support.PersistenceProvider
All Implemented Interfaces:
Serializable, Comparable<PersistenceProvider>, QueryExtractor

public enum PersistenceProvider
extends Enum<PersistenceProvider>
implements QueryExtractor

Enumeration representing peristence providers to be used.

Author:
Oliver Gierke

Enum Constant Summary
ECLIPSELINK
          EclipseLink persistence provider.
GENERIC_JPA
          Unknown special provider.
HIBERNATE
          Hibernate persistence provider.
OPEN_JPA
          OpenJpa persistence provider.
 
Method Summary
 boolean canExtractQuery()
          Returns whether the extractor is able to extract the original query string from a given Query.
static PersistenceProvider fromEntityManager(javax.persistence.EntityManager em)
          Determines the PersistenceProvider from the given EntityManager.
protected  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.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.springframework.data.jpa.repository.query.QueryExtractor
extractQueryString
 

Enum Constant Detail

HIBERNATE

public static final PersistenceProvider HIBERNATE
Hibernate persistence provider.


ECLIPSELINK

public static final PersistenceProvider ECLIPSELINK
EclipseLink persistence provider.


OPEN_JPA

public static final PersistenceProvider OPEN_JPA
OpenJpa persistence provider.


GENERIC_JPA

public static final PersistenceProvider GENERIC_JPA
Unknown special provider. Use standard JPA.

Method Detail

values

public static PersistenceProvider[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (PersistenceProvider c : PersistenceProvider.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static PersistenceProvider valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

fromEntityManager

public static PersistenceProvider fromEntityManager(javax.persistence.EntityManager em)
Determines the PersistenceProvider from the given EntityManager. If no special one can be determined will be returned.

Parameters:
em -
Returns:

canExtractQuery

public boolean canExtractQuery()
Description copied from interface: QueryExtractor
Returns whether the extractor is able to extract the original query string from a given Query.

Specified by:
canExtractQuery in interface QueryExtractor
Returns:

getCountQueryPlaceholder

protected String getCountQueryPlaceholder()
Returns the placeholder to be used for simple count queries. Default implementation returns *.

Returns:

Spring Data Jpa

Copyright © 2011-2012-2012 SpringSource. All Rights Reserved.