Class ModelMapping

  • All Implemented Interfaces:
    java.io.Serializable
    Direct Known Subclasses:
    AggregateMapping, EntityMapping

    public abstract class ModelMapping
    extends java.lang.Object
    implements java.io.Serializable
    Author:
    Javier Paniza
    See Also:
    Serialized Form
    • Constructor Detail

      • ModelMapping

        public ModelMapping()
    • Method Detail

      • fillWithDefaultValues

        public void fillWithDefaultValues()
        Since:
        5.6
      • getType

        public java.lang.Class getType​(java.lang.String propertyName)
                                throws XavaException
        Util specially to find out the type of properties that are not in model, only in mapping.
        Throws:
        XavaException
      • getTable

        public java.lang.String getTable()
      • setTable

        public void setTable​(java.lang.String tabla)
      • getSchema

        public java.lang.String getSchema()
      • getUnqualifiedTable

        public java.lang.String getUnqualifiedTable()
      • getTableToQualifyColumn

        public java.lang.String getTableToQualifyColumn()
      • getModelProperties

        public java.util.Collection getModelProperties()
        In the order that they was added.
        Returns:
        Collection of String.
      • getColumns

        public java.util.Collection getColumns()
        In the order that they was added.
        Returns:
        Collection of String.
      • yearSQLFunction

        public java.lang.String yearSQLFunction​(java.lang.String column)
        Wraps the column name with the SQL function for extracting the year from a date.
      • monthSQLFunction

        public java.lang.String monthSQLFunction​(java.lang.String column)
        Wraps the column name with the SQL function for extracting the month from a date.
      • translateSQLFunction

        public java.lang.String translateSQLFunction​(java.lang.String column)
        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

        public java.lang.String getQualifiedColumn​(java.lang.String modelProperty)
                                            throws XavaException
        Throws:
        XavaException
      • hasConverter

        public boolean hasConverter​(java.lang.String propertyName)
        If the property exists and has converter.
      • changePropertiesByColumns

        public java.lang.String changePropertiesByColumns​(java.lang.String source)
                                                   throws XavaException
        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 name

        For example, it would change:

         select ${number}, ${name} from ${Tercero}
         
        by
         select G4GENBD.GENTGER.TGRCOD, G4GENBD.GENTGER.TGRDEN from G4GENBD.GENTGER
         
        Throws:
        XavaException
      • changePropertiesByNotQualifiedColumns

        public java.lang.String changePropertiesByNotQualifiedColumns​(java.lang.String source)
                                                               throws XavaException
        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}
         
        by
         select TGRCOD, TGRDEN
         from G4GENBD.GENTGER
         
        Throws:
        XavaException
      • changePropertiesByCMPAttributes

        public java.lang.String changePropertiesByCMPAttributes​(java.lang.String source)
                                                         throws XavaException
        Throws:
        XavaException
      • hasPropertyMapping

        public boolean hasPropertyMapping​(java.lang.String memberName)
      • hasReferenceMapping

        public boolean hasReferenceMapping​(MetaReference metaReference)
      • isReferenceOverlappingWithSomeProperty

        public boolean isReferenceOverlappingWithSomeProperty​(java.lang.String reference,
                                                              java.lang.String propertiesOfReference)
                                                       throws XavaException
        Throws:
        XavaException
      • isReferenceOverlappingWithSomeProperty

        public boolean isReferenceOverlappingWithSomeProperty​(java.lang.String reference)
                                                       throws XavaException
        Throws:
        XavaException
      • isReferencePropertyOverlappingWithSomeProperty

        public boolean isReferencePropertyOverlappingWithSomeProperty​(java.lang.String qualifiedProperty)
                                                               throws XavaException
        Throws:
        XavaException
      • getOverlappingPropertyForReference

        public java.lang.String getOverlappingPropertyForReference​(java.lang.String reference,
                                                                   java.lang.String propertyOfReference)
                                                            throws XavaException
        Throws:
        XavaException - If it does not have a overlapped property, or any other problem.
      • getOverlappingPropertiesOfReference

        public java.util.Collection getOverlappingPropertiesOfReference​(java.lang.String reference)
                                                                 throws XavaException
        Returns:
        Of String and not null.
        Throws:
        XavaException
      • getPropertyMappingsNotInModel

        public java.util.Collection getPropertyMappingsNotInModel()
                                                           throws XavaException
        Throws:
        XavaException
      • hasReferenceConverters

        public boolean hasReferenceConverters()
      • getReferenceMappingsWithConverter

        public java.util.Collection getReferenceMappingsWithConverter()