gov.usda.gdpc.panzea
Class PanzeaPositionMinutesDatabaseMapping

java.lang.Object
  extended bygov.usda.gdpc.database.AbstractDatabaseMapping
      extended bygov.usda.gdpc.panzea.PanzeaPositionMinutesDatabaseMapping
All Implemented Interfaces:
DatabaseMapping

public class PanzeaPositionMinutesDatabaseMapping
extends AbstractDatabaseMapping

Author:
terryc

Field Summary
 
Fields inherited from class gov.usda.gdpc.database.AbstractDatabaseMapping
myProperty
 
Constructor Summary
PanzeaPositionMinutesDatabaseMapping(Property property, java.lang.String dbtable, java.lang.String postionField, java.lang.String minutesField)
          PanzeaPositionMinutesDatabaseMapping Constructor.
 
Method Summary
 boolean equals(java.lang.Object obj)
          This determines if two database mapping are equal.
 java.lang.String getDBTable()
           
 java.lang.String[] getDBTables()
          This returns a list of database tables associated with this database mapping.
 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 getMinutesField()
           
 java.lang.String getPositionField()
           
 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 gov.usda.gdpc.database.AbstractDatabaseMapping
getProperty
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PanzeaPositionMinutesDatabaseMapping

public PanzeaPositionMinutesDatabaseMapping(Property property,
                                            java.lang.String dbtable,
                                            java.lang.String postionField,
                                            java.lang.String minutesField)
PanzeaPositionMinutesDatabaseMapping Constructor. This represents a panzea position/minutes mapping from a property to two field in a database table.

Parameters:
property - associated property. null is creating a mapping to use for matching against a property map.
dbtable - database table
postionField - database field from table
minutesField - database field from table
Method Detail

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 - filter
extraInfo - this is not used by this database mapping
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 set
extraInfo - this is not used by this database mapping
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

equals

public boolean equals(java.lang.Object obj)
This determines if two database mapping are equal. In this case, two panzea position/minutes database mappings are equal if the database table, the position field, and the minutes field are the same.

Parameters:
obj - object to test
Returns:
true if equal

getDBTables

public java.lang.String[] getDBTables()
This returns a list of database tables associated with this database mapping.

Returns:
list of database tables. empty list if none.

getPositionField

public java.lang.String getPositionField()

getMinutesField

public java.lang.String getMinutesField()

getDBTable

public java.lang.String getDBTable()

toString

public java.lang.String toString()
Returns the string representation of this database mapping.

Overrides:
toString in class AbstractDatabaseMapping
Returns:
string representation