com.trg.search.jpa
Class JPAAnnotationMetadataUtil

java.lang.Object
  extended by com.trg.search.jpa.JPAAnnotationMetadataUtil
All Implemented Interfaces:
MetadataUtil

public class JPAAnnotationMetadataUtil
extends java.lang.Object
implements MetadataUtil


Constructor Summary
JPAAnnotationMetadataUtil()
           
 
Method Summary
 Metadata get(java.lang.Class<?> klass)
          Get the Metadata for an entity class.
 Metadata get(java.lang.Class<?> rootEntityClass, java.lang.String propertyPath)
          Get the Metadata for a property of an entity class.
 java.io.Serializable getId(java.lang.Object object)
          Get the value of the ID property of an entity.
<T> java.lang.Class<T>
getUnproxiedClass(java.lang.Class<?> klass)
          Return the actual entity class registered with the persistence provider.
<T> java.lang.Class<T>
getUnproxiedClass(java.lang.Object entity)
          Return the actual entity class registered with the persistence provider.
 boolean isId(java.lang.Class<?> rootClass, java.lang.String propertyPath)
          Return true if the property at the given property path is the id of some entity.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JPAAnnotationMetadataUtil

public JPAAnnotationMetadataUtil()
Method Detail

get

public Metadata get(java.lang.Class<?> klass)
Description copied from interface: MetadataUtil
Get the Metadata for an entity class.

Specified by:
get in interface MetadataUtil

get

public Metadata get(java.lang.Class<?> rootEntityClass,
                    java.lang.String propertyPath)
Description copied from interface: MetadataUtil
Get the Metadata for a property of an entity class. The property can be simple ("name") or nested ("organization.name").

Specified by:
get in interface MetadataUtil

getId

public java.io.Serializable getId(java.lang.Object object)
Description copied from interface: MetadataUtil
Get the value of the ID property of an entity.

Specified by:
getId in interface MetadataUtil

isId

public boolean isId(java.lang.Class<?> rootClass,
                    java.lang.String propertyPath)
Description copied from interface: MetadataUtil
Return true if the property at the given property path is the id of some entity.

Specified by:
isId in interface MetadataUtil

getUnproxiedClass

public <T> java.lang.Class<T> getUnproxiedClass(java.lang.Class<?> klass)
Description copied from interface: MetadataUtil
Return the actual entity class registered with the persistence provider. This may be the same class or it may be different if the given class is is a proxy. For example, the entity class may be Person, but the class of the proxy may be Person_$$_javassist_5. We need to normalize this to Person so that we can create correct queries and inspect metadata correctly.

Specified by:
getUnproxiedClass in interface MetadataUtil

getUnproxiedClass

public <T> java.lang.Class<T> getUnproxiedClass(java.lang.Object entity)
Description copied from interface: MetadataUtil
Return the actual entity class registered with the persistence provider. This may be the same as entity.getClass() or it may be different if the object is is a proxy. For example, the entity class may be Person, but the class of the proxy object may be Person_$$_javassist_5. We need to normalize this to Person so that we can create correct queries and inspect metadata correctly.

Specified by:
getUnproxiedClass in interface MetadataUtil


Copyright © 2008-2010 eBM WebSourcing. All Rights Reserved.