org.lsst.ccs.config
Class HqlDAO

java.lang.Object
  extended by org.lsst.ccs.config.HqlDAO
All Implemented Interfaces:
DBInterface
Direct Known Subclasses:
HibernateDAO

public abstract class HqlDAO
extends Object
implements DBInterface

abstract class used to help build DAO that uses HQL but are in a different package

Author:
bamade

Nested Class Summary
static interface HqlDAO.AbstractQuery
          delegate to Hibernate Query type
static interface HqlDAO.AbstractSession
          delegate to Hibernate Session type
 
Field Summary
protected  boolean exceptionFired
           
protected  HqlDAO.AbstractSession session
           
 
Constructor Summary
HqlDAO()
           
 
Method Summary
 void deleteActiveConfigProfile(org.lsst.ccs.config.AConfigProfile oldProfile)
          delectes the active profile from DB
 void deleteActiveSubsystemDescription(org.lsst.ccs.config.ASubsystemDescription oldDescription)
          deletes an active description
 org.lsst.ccs.config.AConfigProfile getActiveConfigProfile(String name, String tag)
          get configProfile with name and tag
 Collection<org.lsst.ccs.config.AConfigProfile> getActiveProfilesForSubsystem(org.lsst.ccs.config.ASubsystemDescription description)
          gets the active configProfiles that references an active SubsystemDescription
 org.lsst.ccs.config.ASubsystemDescription getActiveSubsystemDescription(long id)
          gets a subsystem descirption by it"s id
 org.lsst.ccs.config.ASubsystemDescription getActiveSubsystemDescription(String name, String tag)
          gets a SubsystemDescription in the corresponding active object table.
 org.lsst.ccs.config.GhostSubsystemDescription getGhostDescription(long id)
          returns ghost with corresponding id
 MachineConfiguration getMachineConfiguration(String macAddress)
          get a machine configuration..
 PreparedConfiguration getPreparedConfiguration(String subsystemName, String configName, String tag)
          returns a prepared Configuration
 Collection<org.lsst.ccs.config.PastConfigProfile> getProfilesForSubsystem(org.lsst.ccs.config.GhostSubsystemDescription description)
          get the deprecated ConfigProfile that referenced a subsystemDescription (active or deprecated)
 HqlDAO.AbstractSession getSession()
           
 void modifyParmConfig(org.lsst.ccs.config.AParameterConfiguration config)
          registers a modified parameter
 void saveConfigProfile(org.lsst.ccs.config.AConfigProfile newProfile)
          saves the new argument: ID is modified and argument becomes immutable.
 void saveGhostDescriptions(org.lsst.ccs.config.GhostSubsystemDescription ghosts)
          saves the argument
 void saveMachineConfiguration(MachineConfiguration machineConfiguration)
          saves a machine configuration
 void savePastProfile(org.lsst.ccs.config.PastConfigProfile deprecatedProfile)
          saves argument
 void savePreparedConfiguration(PreparedConfiguration preparedConfiguration)
          saves a preparedConfiguration
 void saveRun(RunHistory runHistory)
          saves a run history
 void saveSubsystemDescription(org.lsst.ccs.config.ASubsystemDescription newDescription)
          saves the argument: which must now becomes immutable and be numbered (with an ID)
 void setSession(HqlDAO.AbstractSession session)
           
 List<?> simpleHQLRequest(String hqlString)
          execut simple request (read only: select of From)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.lsst.ccs.config.DBInterface
begin, close, end, fail, fail
 

Field Detail

session

protected HqlDAO.AbstractSession session

exceptionFired

protected boolean exceptionFired
Constructor Detail

HqlDAO

public HqlDAO()
Method Detail

getSession

public HqlDAO.AbstractSession getSession()

setSession

public void setSession(HqlDAO.AbstractSession session)

saveSubsystemDescription

public void saveSubsystemDescription(org.lsst.ccs.config.ASubsystemDescription newDescription)
Description copied from interface: DBInterface
saves the argument: which must now becomes immutable and be numbered (with an ID)

Specified by:
saveSubsystemDescription in interface DBInterface

saveGhostDescriptions

public void saveGhostDescriptions(org.lsst.ccs.config.GhostSubsystemDescription ghosts)
Description copied from interface: DBInterface
saves the argument

Specified by:
saveGhostDescriptions in interface DBInterface

getActiveSubsystemDescription

public org.lsst.ccs.config.ASubsystemDescription getActiveSubsystemDescription(String name,
                                                                               String tag)
Description copied from interface: DBInterface
gets a SubsystemDescription in the corresponding active object table.

Specified by:
getActiveSubsystemDescription in interface DBInterface
Returns:
null if not found

getActiveSubsystemDescription

public org.lsst.ccs.config.ASubsystemDescription getActiveSubsystemDescription(long id)
Description copied from interface: DBInterface
gets a subsystem descirption by it"s id

Specified by:
getActiveSubsystemDescription in interface DBInterface
Returns:

getGhostDescription

public org.lsst.ccs.config.GhostSubsystemDescription getGhostDescription(long id)
Description copied from interface: DBInterface
returns ghost with corresponding id

Specified by:
getGhostDescription in interface DBInterface
Returns:
null if not found

deleteActiveSubsystemDescription

public void deleteActiveSubsystemDescription(org.lsst.ccs.config.ASubsystemDescription oldDescription)
Description copied from interface: DBInterface
deletes an active description

Specified by:
deleteActiveSubsystemDescription in interface DBInterface

saveConfigProfile

public void saveConfigProfile(org.lsst.ccs.config.AConfigProfile newProfile)
Description copied from interface: DBInterface
saves the new argument: ID is modified and argument becomes immutable.

Specified by:
saveConfigProfile in interface DBInterface

savePastProfile

public void savePastProfile(org.lsst.ccs.config.PastConfigProfile deprecatedProfile)
Description copied from interface: DBInterface
saves argument

Specified by:
savePastProfile in interface DBInterface

getActiveConfigProfile

public org.lsst.ccs.config.AConfigProfile getActiveConfigProfile(String name,
                                                                 String tag)
Description copied from interface: DBInterface
get configProfile with name and tag

Specified by:
getActiveConfigProfile in interface DBInterface
Returns:
null if not found

deleteActiveConfigProfile

public void deleteActiveConfigProfile(org.lsst.ccs.config.AConfigProfile oldProfile)
Description copied from interface: DBInterface
delectes the active profile from DB

Specified by:
deleteActiveConfigProfile in interface DBInterface

modifyParmConfig

public void modifyParmConfig(org.lsst.ccs.config.AParameterConfiguration config)
Description copied from interface: DBInterface
registers a modified parameter

Specified by:
modifyParmConfig in interface DBInterface

getActiveProfilesForSubsystem

public Collection<org.lsst.ccs.config.AConfigProfile> getActiveProfilesForSubsystem(org.lsst.ccs.config.ASubsystemDescription description)
Description copied from interface: DBInterface
gets the active configProfiles that references an active SubsystemDescription

Specified by:
getActiveProfilesForSubsystem in interface DBInterface
Returns:

getProfilesForSubsystem

public Collection<org.lsst.ccs.config.PastConfigProfile> getProfilesForSubsystem(org.lsst.ccs.config.GhostSubsystemDescription description)
Description copied from interface: DBInterface
get the deprecated ConfigProfile that referenced a subsystemDescription (active or deprecated)

Specified by:
getProfilesForSubsystem in interface DBInterface
Returns:

saveRun

public void saveRun(RunHistory runHistory)
Description copied from interface: DBInterface
saves a run history

Specified by:
saveRun in interface DBInterface

savePreparedConfiguration

public void savePreparedConfiguration(PreparedConfiguration preparedConfiguration)
Description copied from interface: DBInterface
saves a preparedConfiguration

Specified by:
savePreparedConfiguration in interface DBInterface

getPreparedConfiguration

public PreparedConfiguration getPreparedConfiguration(String subsystemName,
                                                      String configName,
                                                      String tag)
Description copied from interface: DBInterface
returns a prepared Configuration

Specified by:
getPreparedConfiguration in interface DBInterface
Returns:
null if not found

saveMachineConfiguration

public void saveMachineConfiguration(MachineConfiguration machineConfiguration)
Description copied from interface: DBInterface
saves a machine configuration

Specified by:
saveMachineConfiguration in interface DBInterface

getMachineConfiguration

public MachineConfiguration getMachineConfiguration(String macAddress)
Description copied from interface: DBInterface
get a machine configuration..

Specified by:
getMachineConfiguration in interface DBInterface
Returns:
null if not found

simpleHQLRequest

public List<?> simpleHQLRequest(String hqlString)
Description copied from interface: DBInterface
execut simple request (read only: select of From)

Specified by:
simpleHQLRequest in interface DBInterface
Returns:


Copyright © 2013 LSST. All Rights Reserved.