This class is a concrete Visitor in the "Visitor" pattern.
It defines a way to retrieve a Property
from a database by means of a object to relational mapping.
Each property is kept in one or more database tables.
It is responsability of the "Visitor" implementations to
make the traverse through the hierarchical structure.
author: Abel Muinho author: Fernando Bellas since: 1.0
Constructor Summary
public
FindMetaPropertyVisitor(Connection connection, ResultSet resultSet, Map key) Creates an instance of this class.
Parameters: connection - a connection to the database Parameters: resultSet - the ResultSet that contains the property.The ResultSet could consist of several rows.
buildSimpleProperty(MetaSimpleProperty metaProperty, String[] values) Creates a SimpleProperty given the MetaProperty
describing it and it's values as Strings.
Parameters: metaProperty - The SimpleMetaProperty describing thestructure of the Property to be generated. Parameters: values - String representations of the values to be assigned to theSimpleProperty.
getValues(MetaCompoundProperty metaProperty, ResultSet rs) Creates an array of PropertyStructures representing the
contents of the result set.
Parameters: metaProperty - The MetaCompoundProperty. Parameters: rs - The ResultSet containing the data.
getValues(MetaSimpleProperty metaProperty, ResultSet rs) Gets the values for the properties described by the given
MetaSimpleProperty from the ResultSet.
Parameters: metaProperty - Metainformation about the structure of data. Parameters: rs - The values as retrieved from the database.
visitMetaCompoundProperty(MetaCompoundProperty metaProperty) Visit operation for a MetaCompoundProperty.
Parameters: metaProperty - the MetaCompoundPropertyobject over which the visitor can operate.
visitMetaSimpleProperty(MetaSimpleProperty metaProperty) Visit operation for a MetaSimpleProperty.
Parameters: metaProperty - the MetaSimplePropertyobject over which the visitor can operate.
Creates an instance of this class.
Parameters: connection - a connection to the database Parameters: resultSet - the ResultSet that contains the property.The ResultSet could consist of several rows. Theproperty returned will contain all the values for all the rowsin the ResultSet. Parameters: key - the map that contains pairs of key fields and theircorresponding values. This key are related to the row or rowsin the previosly explained result set.
Creates a SimpleProperty given the MetaProperty
describing it and it's values as Strings.
Parameters: metaProperty - The SimpleMetaProperty describing thestructure of the Property to be generated. Parameters: values - String representations of the values to be assigned to theSimpleProperty. The SimpleProperty created. throws: VisitorException - if the SimpleProperty can't be built.
Creates an array of PropertyStructures representing the
contents of the result set.
Parameters: metaProperty - The MetaCompoundProperty. Parameters: rs - The ResultSet containing the data. An array of PropertyStructures representing thecontents of the given ResultSet. throws: VisitorException - if an error occurs while accessing the data.
Gets the values for the properties described by the given
MetaSimpleProperty from the ResultSet.
Parameters: metaProperty - Metainformation about the structure of data. Parameters: rs - The values as retrieved from the database. String[] The values for use with Proeprty objects. throws: VisitorException - if the values can't be fetched from the ResultSet.
Visit operation for a MetaCompoundProperty.
Parameters: metaProperty - the MetaCompoundPropertyobject over which the visitor can operate. an Object of needful for the caller.In this case it's a CompoundPropertyThis is specially interesting for traverse of "Composite"structures. May be a null value throws: VisitorException - if an internal error occurs while processing the visited object
Visit operation for a MetaSimpleProperty.
Parameters: metaProperty - the MetaSimplePropertyobject over which the visitor can operate. an Object of needful for the caller.In this case it's a SimplePropertyThis is specially interesting for traverse of "Composite"structures. May be a null value throws: VisitorException - if an internal error occurs while processing the visited object
Methods inherited from es.udc.mypersonalizer.kernel.model.repository.sql.storers.AbstractSQLMetaPropertyVisitor