org.unitils.orm.jpa.util
Class JpaAnnotationConfigLoader

java.lang.Object
  extended by org.unitils.util.AnnotationConfigLoader<JpaEntityManagerFactory,JpaConfig>
      extended by org.unitils.orm.jpa.util.JpaAnnotationConfigLoader
All Implemented Interfaces:
ResourceConfigLoader<JpaConfig>

public class JpaAnnotationConfigLoader
extends AnnotationConfigLoader<JpaEntityManagerFactory,JpaConfig>

AnnotationConfigLoader that looks an EntityManagerFactory configured using JpaEntityManagerFactory anntations.

Author:
Filip Neven, Tim Ducheyne

Field Summary
 
Fields inherited from class org.unitils.util.AnnotationConfigLoader
annotationClass
 
Constructor Summary
JpaAnnotationConfigLoader()
           
 
Method Summary
protected  JpaConfig createResourceConfig(JpaEntityManagerFactory configuringAnnotation, Method customConfigMethod)
          Either the given configuring annotation or custom config method must not be null (may also both be not-null)
protected  boolean isConfiguringAnnotation(JpaEntityManagerFactory annotation)
           
protected  boolean isCustomConfigMethod(Method annotatedMethod)
           
 
Methods inherited from class org.unitils.util.AnnotationConfigLoader
getCustomConfigMethod, getResourceConfig, loadResourceConfig
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JpaAnnotationConfigLoader

public JpaAnnotationConfigLoader()
Method Detail

isConfiguringAnnotation

protected boolean isConfiguringAnnotation(JpaEntityManagerFactory annotation)
Specified by:
isConfiguringAnnotation in class AnnotationConfigLoader<JpaEntityManagerFactory,JpaConfig>
Parameters:
annotation - Annotation of type AnnotationConfigLoader.annotationClass
Returns:
True if for the given annotation, the necessary attributes are filled so that it can be regarded as a configuring annotation

createResourceConfig

protected JpaConfig createResourceConfig(JpaEntityManagerFactory configuringAnnotation,
                                         Method customConfigMethod)
Description copied from class: AnnotationConfigLoader
Either the given configuring annotation or custom config method must not be null (may also both be not-null)

Specified by:
createResourceConfig in class AnnotationConfigLoader<JpaEntityManagerFactory,JpaConfig>
Parameters:
configuringAnnotation - Configuring annotation, if any
customConfigMethod - Custom config method, if any
Returns:
A new resource config object, given the configuring annotation and custom configuration method

isCustomConfigMethod

protected boolean isCustomConfigMethod(Method annotatedMethod)
Specified by:
isCustomConfigMethod in class AnnotationConfigLoader<JpaEntityManagerFactory,JpaConfig>
Parameters:
annotatedMethod - A method annotated with AnnotationConfigLoader.annotationClass
Returns:
True if the given method is a custom configuration method


Copyright © 2011. All Rights Reserved.