|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Metadata
This interface provides meta data for a single persistable type. Use MetadataUtil.get(Class) or
MetadataUtil.get(Class, String) to get meta data instances.
This interface provides a layer of abstraction between the framework and the underlying
JPA provider (ex. Hibernate). By switching out the implementation of this interface, the
framework should be able to be used with different JPA providers.
| Method Summary | |
|---|---|
java.lang.Class<?> |
getCollectionClass()
If the type is a collection, return the Java class of the collection itself, not the Java class of it's elements as with getJavaClass(). |
java.lang.String |
getIdProperty()
Return the name of the id property of this type. |
Metadata |
getIdType()
Return the metadata for the id property of this type. |
java.io.Serializable |
getIdValue(java.lang.Object object)
Return the value of the id property of the given object of this type. |
java.lang.Class<?> |
getJavaClass()
Return the Java class of this type. |
java.lang.String[] |
getProperties()
Return an array of the names of all the properties that this type has, if any. |
Metadata |
getPropertyType(java.lang.String property)
Return the metadata for the given property of this type. |
java.lang.Object |
getPropertyValue(java.lang.Object object,
java.lang.String property)
Return the value of the given property of the given object of this type. |
boolean |
isCollection()
Return true if the type is a collection. |
boolean |
isEmeddable()
Return true if the type is an embeddable class (a component class in Hibernate). |
boolean |
isEntity()
Return true if the type is an entity. |
boolean |
isNumeric()
Return true if the type is a number. |
boolean |
isString()
Return true if the type is persisted as a string (char or varchar) type in the database. |
| Method Detail |
|---|
boolean isEntity()
boolean isEmeddable()
boolean isCollection()
boolean isString()
boolean isNumeric()
java.lang.Class<?> getJavaClass()
java.lang.String[] getProperties()
java.lang.Object getPropertyValue(java.lang.Object object,
java.lang.String property)
Metadata getPropertyType(java.lang.String property)
java.lang.String getIdProperty()
Metadata getIdType()
java.io.Serializable getIdValue(java.lang.Object object)
java.lang.Class<?> getCollectionClass()
getJavaClass().
For example: ArrayList<Project>, Set<Person>, String[].
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||