gov.usda.gdpc.database
Class MultiDatabaseMapping
java.lang.Object
gov.usda.gdpc.database.AbstractDatabaseMapping
gov.usda.gdpc.database.MultiDatabaseMapping
- All Implemented Interfaces:
- DatabaseMapping
- public class MultiDatabaseMapping
- extends AbstractDatabaseMapping
- 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. |
java.lang.String |
getSQLSubString(Filter filter,
ExtraInfo extraInfo)
Gets the SQL sub-string based on the given filter. |
java.lang.String |
toString()
Returns the string representation of this database mapping. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
MultiDatabaseMapping
public MultiDatabaseMapping(Property property,
DatabaseMapping[] mappings)
- MultiDatabaseMapping Constructor. This database mapping
groups together any number of mappings into one. The mapping
actually used for any given method call is determined by
the index set in the extra information passed via the method
parameters.
- Parameters:
property - associated propertymappings - list of mappings
getSQLSubString
public java.lang.String getSQLSubString(Filter filter,
ExtraInfo extraInfo)
- Gets the SQL sub-string based on the given filter.
- Specified by:
getSQLSubString in interface DatabaseMapping- Overrides:
getSQLSubString in class AbstractDatabaseMapping
- Parameters:
filter - filterextraInfo - 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.
- Specified by:
getJavaObjects in interface DatabaseMapping- Overrides:
getJavaObjects in class AbstractDatabaseMapping
- Parameters:
rs - result setextraInfo - 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.
- Specified by:
getDistinctSQL in interface DatabaseMapping- Overrides:
getDistinctSQL in class AbstractDatabaseMapping
- Returns:
- SQL statements and corresponding extra information
toString
public java.lang.String toString()
- Returns the string representation of this database mapping.
- Overrides:
toString in class AbstractDatabaseMapping
- Returns:
- string representation