|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.xorm.ClassMapping
A ClassMapping provides the mapping from a Java type (class or interface) to a datastore type. Each field of a Class can map to a Column in a Table, or may be mapped as a RelationshipMapping. A ClassMapping is also the repository for default fetch group information.
Field Summary |
Fields inherited from interface org.xorm.I15d |
I18N |
Constructor Summary | |
ClassMapping(ModelMapping modelMapping,
Class clazz)
Creates a new ClassMapping that maps the given Class. |
|
ClassMapping(ModelMapping modelMapping,
Class clazz,
JDOClass jdoClass)
|
Method Summary | |
Object |
clone()
Creates a shallow clone. |
Column |
getColumn(String field)
Get the Column mapped to the given field. |
Column |
getColumnForMethod(Method method)
Convenience method that gets the Column mapped to a particular get or set method. |
Class |
getDatastoreIdentityType()
Returns the Class specified as the identity-type for a class mapping, or null if none was specified. |
DataFetchGroup |
getDefaultFetchGroup()
|
FieldDescriptor |
getFieldDescriptor(String field)
Retrieves the FieldDescriptor associated with the given field name by iterating through the collection of all FieldDescriptors for this class. |
Collection |
getFieldDescriptors()
Gets the field descriptors found by introspection on the class or interface. |
String |
getFieldForMethod(Method method)
Retrieves the field associated with a get or set method. |
Class |
getFieldType(String field)
Returns the Java type of the field. |
String |
getInverse(String field)
|
Set |
getManagedFields()
Returns the set of managed field names. |
Class |
getMappedClass()
Get the class that this mapping references. |
Set |
getMappedFieldDescriptors()
Gets the set of FieldDescriptors that have column mappings defined in the JDO metadata file. |
RelationshipMapping |
getRelationship(String field)
Get the relationship mapped to a field. |
RelationshipMapping |
getRelationshipForMethod(Method method)
Convenience method to go from a get/set method to the associated relationship mapping. |
Map |
getRelationships()
Get the map of relationships. |
Table |
getTable()
Get the table the class is mapped to. |
static boolean |
isUserType(Class clazz)
Returns true if the class parameter is not a primitive type, a wrapper class for a primitive type, or java.util.Date, java.lang.String, java.util.Locale, java.math.BigDecimal, or java.math.BigInteger. |
void |
setColumn(String field,
Column column,
Boolean inDefaultFetchGroup)
Set the Column mapped to the given field. |
void |
setDatastoreIdentityType(Class datastoreIdentityType)
|
void |
setInverse(String localField,
String inverseField)
|
void |
setRelationship(String field,
RelationshipMapping relation)
Define a to-many relationship on a field. |
void |
setTable(Table table)
Defines the table that will be used to map the class. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ClassMapping(ModelMapping modelMapping, Class clazz)
public ClassMapping(ModelMapping modelMapping, Class clazz, JDOClass jdoClass)
ClassMapping(ModelMapping, Class)
Method Detail |
public Object clone()
clone
in class Object
public static boolean isUserType(Class clazz)
public void setTable(Table table)
public Map getRelationships()
public DataFetchGroup getDefaultFetchGroup()
public Set getMappedFieldDescriptors()
public Collection getFieldDescriptors()
public Set getManagedFields()
public String getInverse(String field)
public void setInverse(String localField, String inverseField)
public String getFieldForMethod(Method method)
public Column getColumnForMethod(Method method)
public Table getTable()
public Class getMappedClass()
public Column getColumn(String field)
public void setColumn(String field, Column column, Boolean inDefaultFetchGroup)
JDOUserException
- if the field does not exist, or if
the field has a set() method but the column is marked as read-only.public void setRelationship(String field, RelationshipMapping relation)
JDOUserException
- if the field does not existpublic FieldDescriptor getFieldDescriptor(String field)
JDOUserException
- if the named field does not exist.public RelationshipMapping getRelationship(String field)
public RelationshipMapping getRelationshipForMethod(Method method)
public Class getFieldType(String field)
public Class getDatastoreIdentityType()
public void setDatastoreIdentityType(Class datastoreIdentityType)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |