Class HibernateUtil
java.lang.Object
com.vaadin.featurepack.data.jpacontainer.util.HibernateUtil
Utility methods for finding Hibernate specific information about entities
without forcing a compile-time dependency on the Hibernate framework.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetMappedByProperty(Object entity, String propertyName) Finds the property's "mappedBy" value.static booleanReflectively finds out if the passed in exception is a Hibernate LazyInitializationException.static booleanReflectively finds out whether an object is an uninitialized Hibernate proxy and unattached.
-
Constructor Details
-
HibernateUtil
public HibernateUtil()
-
-
Method Details
-
isLazyInitializationException
Reflectively finds out if the passed in exception is a Hibernate LazyInitializationException.- Parameters:
e-- Returns:
- true if the exception is a Hibernate LazyInitializationException.
-
isUninitializedAndUnattachedProxy
Reflectively finds out whether an object is an uninitialized Hibernate proxy and unattached.- Parameters:
obj-- Returns:
- true if the object is an uninitialized and unattached Hibernate proxy.
-
getMappedByProperty
Finds the property's "mappedBy" value.- Parameters:
entity- the entity containing the propertypropertyName- the name of the property to find the "mappedBy" value for.- Returns:
- the value of mappedBy in an annotation.
-