|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.ojb.broker.ant.PreparedModel
public class PreparedModel
Provides a model derived from DescriptorRepository
that
is preprocessed for data handling (inserting data, generating data dtd).
Field Summary | |
---|---|
private HashMap |
_elementToClassDescriptors
Maps dtd elements to lists of class descriptors (which all map to the same table) |
private HashMap |
_elementToColumnMap
Maps dtd elements to colum maps which in turn map attribute names to columns |
private HashMap |
_elementToRequiredAttributesMap
Maps dtd elements to maps that specify which attributes are required |
private TreeMap |
_elementToTable
Maps dtd elements to tables |
private org.apache.ddlutils.model.Database |
_schema
The database model. |
Constructor Summary | |
---|---|
PreparedModel(DescriptorRepository model,
org.apache.ddlutils.model.Database schema)
|
Method Summary | |
---|---|
org.apache.commons.beanutils.DynaBean |
createBeanFor(String elementName)
Creates a dyna bean for the table associated to the given element. |
private void |
extractAttributes(ClassDescriptor classDesc,
org.apache.ddlutils.model.Table mappedTable,
Map columnsMap,
Map requiredColumnsMap)
|
private void |
extractIndirectionTables(DescriptorRepository model,
org.apache.ddlutils.model.Database schema)
Extracts indirection tables from the given class descriptor, and adds elements for them. |
Iterator |
getAttributeNames(String elementName)
|
List |
getClassDescriptorsMappingTo(String elementName)
|
org.apache.ddlutils.model.Column |
getColumnFor(String elementName,
String attrName)
|
Map |
getColumnsFor(String elementName)
|
private String |
getElementName(ClassDescriptor classDesc)
Returns the element name for the class descriptor which is the adjusted short (unqualified) class name. |
Iterator |
getElementNames()
|
Map |
getRequiredAttributes(String elementName)
|
private String |
getShortAttributeName(String attrName)
Adjusts the local attribute name (the part after the last '::' for nested fields). |
org.apache.ddlutils.model.Table |
getTableFor(String elementName)
|
boolean |
isRequired(String elementName,
String attributeName)
|
private void |
prepareModel(DescriptorRepository model)
Prepares a representation of the model that is easier accessible for our purposes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private org.apache.ddlutils.model.Database _schema
private TreeMap _elementToTable
private HashMap _elementToClassDescriptors
private HashMap _elementToColumnMap
private HashMap _elementToRequiredAttributesMap
Constructor Detail |
---|
public PreparedModel(DescriptorRepository model, org.apache.ddlutils.model.Database schema)
Method Detail |
---|
public Iterator getElementNames()
public Iterator getAttributeNames(String elementName)
public Map getRequiredAttributes(String elementName)
public boolean isRequired(String elementName, String attributeName)
public org.apache.ddlutils.model.Table getTableFor(String elementName)
public org.apache.commons.beanutils.DynaBean createBeanFor(String elementName)
elementName
- The element name
public List getClassDescriptorsMappingTo(String elementName)
public Map getColumnsFor(String elementName)
public org.apache.ddlutils.model.Column getColumnFor(String elementName, String attrName)
private void prepareModel(DescriptorRepository model)
model
- The original modelprivate void extractAttributes(ClassDescriptor classDesc, org.apache.ddlutils.model.Table mappedTable, Map columnsMap, Map requiredColumnsMap)
private void extractIndirectionTables(DescriptorRepository model, org.apache.ddlutils.model.Database schema)
model
- The modelelements
- The elementsprivate String getElementName(ClassDescriptor classDesc)
classDesc
- The class descriptor
private String getShortAttributeName(String attrName)
attrName
- The original attribute name
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |