Package org.openxava.mapping
Class ModelMapping
java.lang.Object
org.openxava.mapping.ModelMapping
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
AggregateMapping,EntityMapping
- Author:
- Javier Paniza
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPropertyMapping(PropertyMapping propertyMapping) voidaddReferenceMapping(ReferenceMapping referenceMapping) changePropertiesByColumns(String source) Change the properties inside ${ } by the database qualified(schema + table) columns.Change the properties inside ${ } by the database columns without table and schema as prefix.voidSupport the use of references with dots, this is: myreference.myproperty.In the order that they was added.getConverter(String modelProperty) abstract MetaModelabstract StringIn the order that they was added.getMultipleConverter(String modelProperty) getOverlappingPropertiesOfReference(String reference) getOverlappingPropertyForReference(String reference, String propertyOfReference) getPropertyMapping(String name) getQualifiedColumn(String modelProperty) getReferenceMapping(String name) getTable()Util specially to find out the type of properties that are not in model, only in mapping.booleanhasConverter(String propertyName) If the property exists and has converter.booleanhasPropertyMapping(String memberName) booleanbooleanhasReferenceMapping(MetaReference metaReference) booleanisReferenceOverlappingWithSomeProperty(String reference) booleanisReferenceOverlappingWithSomeProperty(String reference, String propertiesOfReference) booleanisReferencePropertyOverlappingWithSomeProperty(String qualifiedProperty) monthSQLFunction(String column) Wraps the column name with the SQL function for extracting the month from a date.voidsetMetaComponent(MetaComponent componente) voidtranslateSQLFunction(String column) To ignore accents: just to search 'cami�n' or 'camion' Good performance using 'translate' but is very slow when it use 'replace...'yearSQLFunction(String column) Wraps the column name with the SQL function for extracting the year from a date.
-
Constructor Details
-
ModelMapping
public ModelMapping()
-
-
Method Details
-
getModelName
- Throws:
XavaException
-
getMetaModel
- Throws:
XavaException
-
fillWithDefaultValues
public void fillWithDefaultValues()- Since:
- 5.6
-
getType
Util specially to find out the type of properties that are not in model, only in mapping.- Throws:
XavaException
-
getTable
-
setTable
-
getSchema
-
getUnqualifiedTable
-
getTableToQualifyColumn
-
addPropertyMapping
- Throws:
XavaException
-
addReferenceMapping
- Throws:
XavaException
-
getReferenceMapping
public ReferenceMapping getReferenceMapping(String name) throws XavaException, ElementNotFoundException - Returns:
- Not null
- Throws:
XavaExceptionElementNotFoundException
-
getPropertyMapping
public PropertyMapping getPropertyMapping(String name) throws XavaException, ElementNotFoundException - Returns:
- Not null
- Throws:
XavaExceptionElementNotFoundException
-
getModelProperties
In the order that they was added.- Returns:
- Collection of String.
-
getColumns
In the order that they was added.- Returns:
- Collection of String.
-
getKeyColumnsAsString
- Throws:
XavaException
-
yearSQLFunction
Wraps the column name with the SQL function for extracting the year from a date. -
monthSQLFunction
Wraps the column name with the SQL function for extracting the month from a date. -
translateSQLFunction
To ignore accents: just to search 'cami�n' or 'camion' Good performance using 'translate' but is very slow when it use 'replace...'- Since:
- v4m6
-
getQualifiedColumn
- Throws:
XavaException
-
getColumn
Support the use of references with dots, this is: myreference.myproperty. -
getConverter
- Returns:
- nulo If property exists but it does not have converter.
- Throws:
ElementNotFoundException- If property does not exist.XavaException- Any problem
-
getMultipleConverter
public IMultipleConverter getMultipleConverter(String modelProperty) throws ElementNotFoundException, XavaException - Returns:
- nulo If property exists but it does not have converter.
- Throws:
ElementNotFoundException- If property does not exist.XavaException- Any problem
-
hasConverter
If the property exists and has converter. -
getMetaComponent
-
setMetaComponent
- Throws:
XavaException
-
changePropertiesByColumns
Change the properties inside ${ } by the database qualified(schema + table) columns. Also if the property inside ${ } is a model name it changes by the table nameFor example, it would change:
select ${number}, ${name} from ${Tercero}byselect G4GENBD.GENTGER.TGRCOD, G4GENBD.GENTGER.TGRDEN from G4GENBD.GENTGER
- Throws:
XavaException
-
changePropertiesByNotQualifiedColumns
Change the properties inside ${ } by the database columns without table and schema as prefix. Also if the property inside ${ } is a model name it changes by the table name.For example, it would change:
select ${number}, ${name} from ${Tercero}byselect TGRCOD, TGRDEN from G4GENBD.GENTGER
- Throws:
XavaException
-
changePropertiesByCMPAttributes
- Throws:
XavaException
-
hasPropertyMapping
-
hasReferenceMapping
-
isReferenceOverlappingWithSomeProperty
public boolean isReferenceOverlappingWithSomeProperty(String reference, String propertiesOfReference) throws XavaException - Throws:
XavaException
-
isReferenceOverlappingWithSomeProperty
- Throws:
XavaException
-
isReferencePropertyOverlappingWithSomeProperty
public boolean isReferencePropertyOverlappingWithSomeProperty(String qualifiedProperty) throws XavaException - Throws:
XavaException
-
getOverlappingPropertyForReference
public String getOverlappingPropertyForReference(String reference, String propertyOfReference) throws XavaException - Throws:
XavaException- If it does not have a overlapped property, or any other problem.
-
getOverlappingPropertiesOfReference
- Returns:
- Of String and not null.
- Throws:
XavaException
-
getPropertyMappingsNotInModel
- Throws:
XavaException
-
getCmpFields
- Throws:
XavaException
-
hasReferenceConverters
public boolean hasReferenceConverters() -
getReferenceMappingsWithConverter
-