gov.usda.gdpc.database
Interface DatabaseMapping

All Known Implementing Classes:
AbstractDatabaseMapping

public interface DatabaseMapping

This is a database mapping. It maps a property (type: Property) to the actual data in the database.

Author:
terryc

Method Summary
 SQLStatements getDistinctSQL()
          Returns the SQL statements required to get the distinct values for the property associated with this mapping.
 java.util.List getJavaObjects(java.sql.ResultSet rs, ExtraInfo extraInfo)
          Gets the data from the given result set as Java objects.
 Property getProperty()
          Gets the property associated with this database mapping.
 java.lang.String getSQLSubString(Filter filter, ExtraInfo extraInfo)
          Gets the SQL sub-string based on the given filter.
 

Method Detail

getProperty

public Property getProperty()
Gets the property associated with this database mapping.

Returns:
the property

getSQLSubString

public java.lang.String getSQLSubString(Filter filter,
                                        ExtraInfo extraInfo)
Gets the SQL sub-string based on the given filter.

Parameters:
filter - filter
extraInfo - this is extra information that can be used by this database mapping to generate the SQL.
Returns:
SQL sub-string

getJavaObjects

public java.util.List getJavaObjects(java.sql.ResultSet rs,
                                     ExtraInfo extraInfo)
                              throws java.sql.SQLException
Gets the data from the given result set as Java objects. The actual type of objects returned will match what's specified by the property associated with this mapping.

Parameters:
rs - result set
extraInfo - this is extra information that can be used by this database mapping to generate the Java objects.
Returns:
list of converted data
Throws:
java.sql.SQLException

getDistinctSQL

public SQLStatements getDistinctSQL()
Returns the SQL statements required to get the distinct values for the property associated with this mapping.

Returns:
SQL statements and corresponding extra information