org.opensha.refFaultParamDb.dao.db
Class PaleoSiteDB_DAO

java.lang.Object
  extended by org.opensha.refFaultParamDb.dao.db.PaleoSiteDB_DAO

public class PaleoSiteDB_DAO
extends Object

Title: PaleoSiteDB_DAO.java

Description: Performs insert/delete/update on PaleoSite table on oracle database

Copyright: Copyright (c) 2002

Company:

Version:
1.0
Author:
not attributable

Constructor Summary
PaleoSiteDB_DAO(DB_AccessAPI dbAccess)
           
 
Method Summary
 void addPaleoSite(PaleoSite paleoSite)
          Add a new paleo site
 ArrayList<PaleoSiteSummary> getAllPaleoSiteNames()
          It returns a list of PaleoSiteSummary objects.
 ArrayList<PaleoSite> getAllPaleoSites()
          Get all the paleo sites from the database
 PaleoSite getPaleoSite(int paleoSiteId)
          Get paleo site data based on paleoSiteId
 PaleoSite getPaleoSite(String paleoSiteName)
          Get paleo site data based on paleoSiteName
 PaleoSite getPaleoSiteByQfaultId(String qFaultSiteId)
          Get paleo site data based on qfaultSiteId
 ArrayList<PaleoSite> getPaleoSiteNameIdAndLocations()
          Get a list of PaleoSites which just have Id, Name and Locations
static void main(String[] args)
           
 boolean removePaleoSite(int paleoSiteId)
          remove a paleo site from the database
 void setDB_Connection(DB_AccessAPI dbAccess)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PaleoSiteDB_DAO

public PaleoSiteDB_DAO(DB_AccessAPI dbAccess)
Method Detail

setDB_Connection

public void setDB_Connection(DB_AccessAPI dbAccess)

addPaleoSite

public void addPaleoSite(PaleoSite paleoSite)
                  throws InsertException
Add a new paleo site

Parameters:
paleoSite -
Throws:
InsertException

getPaleoSite

public PaleoSite getPaleoSite(int paleoSiteId)
                       throws QueryException
Get paleo site data based on paleoSiteId

Parameters:
paleoSiteId -
Returns:
Throws:
QueryException

getPaleoSiteByQfaultId

public PaleoSite getPaleoSiteByQfaultId(String qFaultSiteId)
                                 throws QueryException
Get paleo site data based on qfaultSiteId

Parameters:
qFaultSiteId -
Returns:
Throws:
QueryException

getPaleoSite

public PaleoSite getPaleoSite(String paleoSiteName)
                       throws QueryException
Get paleo site data based on paleoSiteName

Parameters:
paleoSiteName -
Returns:
Throws:
QueryException

getAllPaleoSiteNames

public ArrayList<PaleoSiteSummary> getAllPaleoSiteNames()
                                                 throws QueryException
It returns a list of PaleoSiteSummary objects. Each such object has a name and id. If there is no name corresponding to paleo site in the database, then this function gets the references for the paleo site and sets it as the name which can then be used subsequently.

Returns:
Throws:
QueryException

getPaleoSiteNameIdAndLocations

public ArrayList<PaleoSite> getPaleoSiteNameIdAndLocations()
                                                    throws QueryException
Get a list of PaleoSites which just have Id, Name and Locations

Returns:
Throws:
QueryException

removePaleoSite

public boolean removePaleoSite(int paleoSiteId)
                        throws UpdateException
remove a paleo site from the database

Parameters:
paleoSiteId -
Returns:
Throws:
UpdateException

getAllPaleoSites

public ArrayList<PaleoSite> getAllPaleoSites()
                                      throws QueryException
Get all the paleo sites from the database

Returns:
Throws:
QueryException

main

public static void main(String[] args)