|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.vaadin.addon.jpacontainer.metadata.ClassMetadata<T>
public class ClassMetadata<T>
This class provides a way of accessing the JPA mapping metadata of
Entity and Embeddable classes. This information may be used
to construct queries or decide whether a property is sortable or not.
EntityClassMetadata,
Serialized Form| Method Summary | |
|---|---|
boolean |
equals(Object obj)
|
protected Method |
getGetterMethod(String propertyName,
Class<?> parent)
Gets the getter method for propertyName from
parent. |
Class<T> |
getMappedClass()
Gets the mapped class. |
Collection<PersistentPropertyMetadata> |
getPersistentProperties()
Gets all the persistent properties of the class. |
Collection<String> |
getPersistentPropertyNames()
Gets the names of all persistent properties of this class. |
Collection<PropertyMetadata> |
getProperties()
Gets all the properties of the class. |
PropertyMetadata |
getProperty(String propertyName)
Gets the metadata of the named property. |
Collection<String> |
getPropertyNames()
Gets the names of all the properties of this class. |
protected Object |
getPropertyValue(T object,
PropertyMetadata property)
Gets the value of property from object. |
Object |
getPropertyValue(T object,
String propertyName)
Gets the value of object.propertyName. |
protected Method |
getSetterMethod(String propertyName,
Class<?> parent,
Class<?> propertyType)
Gets the setter method for propertyName from
parent. |
int |
hashCode()
|
protected void |
setPropertyValue(T object,
PropertyMetadata property,
Object value)
Sets the value of property to value on
object. |
void |
setPropertyValue(T object,
String propertyName,
Object value)
Sets the value of object.propertyName to value. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public Class<T> getMappedClass()
public Collection<PersistentPropertyMetadata> getPersistentProperties()
public Collection<String> getPersistentPropertyNames()
getPersistentProperties()public Collection<PropertyMetadata> getProperties()
public Collection<String> getPropertyNames()
getProperties()public PropertyMetadata getProperty(String propertyName)
propertyName - the name of the property (must not be null).
protected Object getPropertyValue(T object,
PropertyMetadata property)
throws IllegalArgumentException
property from object.
object - the object from which the property will be retrieved (must not
be null).property - the metadata of the property (must not be null).
IllegalArgumentException - if the property could not be retrieved.
protected void setPropertyValue(T object,
PropertyMetadata property,
Object value)
throws IllegalArgumentException
property to value on
object.
object - the object to which the property will be set (must not be
null).property - the metadata of the property (must not be null).value - the property value.
IllegalArgumentException - if the property could not be set.
protected Method getGetterMethod(String propertyName,
Class<?> parent)
propertyName from
parent.
propertyName - the JavaBean property name (must not be null).parent - the class from which to get the getter method (must not be
null).
protected Method getSetterMethod(String propertyName,
Class<?> parent,
Class<?> propertyType)
propertyName from
parent.
propertyName - the JavaBean property name (must not be null).parent - the class from which to get the setter method (must not be
null).propertyType - the type of the property (must not be null).
public Object getPropertyValue(T object,
String propertyName)
throws IllegalArgumentException
object.propertyName. The property name may
be nested.
object - the entity object from which the property value should be
fetched (must not be null).propertyName - the name of the property (must not be null).
IllegalArgumentException - if the property value could not be fetched, e.g. due to
propertyName being invalid.
public void setPropertyValue(T object,
String propertyName,
Object value)
throws IllegalArgumentException,
IllegalStateException
object.propertyName to value.
The property name may be nested.
object - the object whose property should be set (must not be null).propertyName - the name of the property to set (must not be null).value - the value to set.
IllegalArgumentException - if the value could not be set, e.g. due to
propertyName being invalid or the property being
read only.
IllegalStateException - if a nested property name is used and one of the nested
properties (other than the last one) is null.public boolean equals(Object obj)
equals in class Objectpublic int hashCode()
hashCode in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||