Spring Data Jpa

org.springframework.data.jpa.repository.utils
Class JpaClassUtils

java.lang.Object
  extended by org.springframework.data.jpa.repository.utils.JpaClassUtils

public abstract class JpaClassUtils
extends Object

Utility class to work with classes.

Author:
Oliver Gierke

Method Summary
static String getEntityName(Class<?> domainClass)
          Returns the name ot the entity represented by this class.
static
<T> JpaEntityInformation<T,?>
getMetadata(Class<T> domainClass, javax.persistence.EntityManager em)
          Creates a JpaEntityInformation for the given domain class and EntityManager.
static boolean isEntityManagerOfType(javax.persistence.EntityManager em, String type)
          Returns whether the given EntityManager is of the given type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isEntityManagerOfType

public static boolean isEntityManagerOfType(javax.persistence.EntityManager em,
                                            String type)
Returns whether the given EntityManager is of the given type.

Parameters:
em -
type - the fully qualified expected EntityManager type.
Returns:

getEntityName

public static String getEntityName(Class<?> domainClass)
Returns the name ot the entity represented by this class. Used to build queries for that class.

Parameters:
domainClass -
Returns:

getMetadata

public static <T> JpaEntityInformation<T,?> getMetadata(Class<T> domainClass,
                                                        javax.persistence.EntityManager em)
Creates a JpaEntityInformation for the given domain class and EntityManager.

Parameters:
domainClass -
em -
Returns:

Spring Data Jpa

Copyright © 2011 SpringSource. All Rights Reserved.