net.sf.jagzilla
Class SystemQueryHibernateImpl

java.lang.Object
  extended bynet.sf.jagzilla.BaseQuery
      extended bynet.sf.jagzilla.SystemQueryHibernateImpl
All Implemented Interfaces:
SystemQuery

public class SystemQueryHibernateImpl
extends BaseQuery
implements SystemQuery

an implementation which will use hibernate to implement methods.

Author:
mike

Field Summary
 
Fields inherited from class net.sf.jagzilla.BaseQuery
eventHandler, hibernateProperties, session, sessionFactory
 
Constructor Summary
SystemQueryHibernateImpl()
           
SystemQueryHibernateImpl(java.util.Properties p)
           
 
Method Summary
 void addCc(int bugId, int profileId)
          adds a profile to the cc list of a bug.
 void finalize()
           
 java.util.List getAllComponents()
          gets a list of all components in the system regardless of which product they belong to.
 BugQuery getBugQuery()
          gets an instance of the BugQuery with transport configuration of actual implementation.
 java.util.List getComponentNames(java.lang.String product)
          gets a list of component names.
 java.util.List getComponents(java.lang.String product)
          gets all components for a product.
 java.util.List getMilestoneNames(java.lang.String product)
          gets a list of milestone names for the given product.
 java.util.List getMilestones(java.lang.String product)
          gets all milestones for a given product.
 java.util.List getProductNames()
          gets a List of strings of product names in database.
 java.util.List getProducts()
          gets a List of Products in database.
 Profile getProfile(int userId)
          gets the profile for a given user id.
 java.util.List getProfiles()
          gets all profiles in database.
 int getUserId(java.lang.String login)
          gets the id of the user given it's login.
 java.util.List getVersionNames(java.lang.String product)
          gets a list of version names for a given product
 java.util.List getVersions(java.lang.String product)
          gets all versions for a given product.
 void removeCc(int bugId, int profileId)
          removes a profile from the cc list of a bug.
 
Methods inherited from class net.sf.jagzilla.BaseQuery
bugExists, componentExists, continueIfProductExists, continueIfResolutionExists, continueIfStatusExists, continueIfUsersExists, getEventHandler, getFieldId, getNewSession, locateBug, locateComponent, locateProduct, locateProfile, milestoneExists, priorityExists, productExists, queryCountValue, resolutionExists, setHibernateProperties, severityExists, statusExists, userExists, versionExists
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SystemQueryHibernateImpl

public SystemQueryHibernateImpl(java.util.Properties p)
                         throws HibernateException

SystemQueryHibernateImpl

public SystemQueryHibernateImpl()
                         throws HibernateException
Method Detail

getProducts

public java.util.List getProducts()
                           throws JagzillaException
Description copied from interface: SystemQuery
gets a List of Products in database.

Specified by:
getProducts in interface SystemQuery
Returns:
a List containing one entry (class Product) for each Product found
Throws:
JagzillaException - if an error occurs
See Also:
Product, Product

getProductNames

public java.util.List getProductNames()
                               throws JagzillaException
Description copied from interface: SystemQuery
gets a List of strings of product names in database.

Specified by:
getProductNames in interface SystemQuery
Returns:
a List containing one entry (class String) for each Product found
Throws:
JagzillaException - if an error occurs

getComponents

public java.util.List getComponents(java.lang.String product)
                             throws JagzillaException,
                                    NoSuchProductException
Description copied from interface: SystemQuery
gets all components for a product.

Specified by:
getComponents in interface SystemQuery
Parameters:
product - the product for which components are queried
Returns:
a List of components
Throws:
NoSuchProductException - if the product specified in product cannot be found
JagzillaException - if an error occurs
See Also:
Component, Component

getComponentNames

public java.util.List getComponentNames(java.lang.String product)
                                 throws JagzillaException
Description copied from interface: SystemQuery
gets a list of component names.

Specified by:
getComponentNames in interface SystemQuery
Parameters:
product -
Returns:
Throws:
JagzillaException

getVersions

public java.util.List getVersions(java.lang.String product)
                           throws JagzillaException
Description copied from interface: SystemQuery
gets all versions for a given product.

Specified by:
getVersions in interface SystemQuery
Parameters:
product - to query versions from
Returns:
a List containing Version
Throws:
JagzillaException - if an error occurs
See Also:
Version, Version

getVersionNames

public java.util.List getVersionNames(java.lang.String product)
                               throws JagzillaException
Description copied from interface: SystemQuery
gets a list of version names for a given product

Specified by:
getVersionNames in interface SystemQuery
Parameters:
product -
Returns:
Throws:
JagzillaException

getMilestones

public java.util.List getMilestones(java.lang.String product)
                             throws JagzillaException
Description copied from interface: SystemQuery
gets all milestones for a given product.

Specified by:
getMilestones in interface SystemQuery
Parameters:
product - to query milestones from
Returns:
a List containing Milestones
Throws:
JagzillaException - if an error occurs
See Also:
Milestone

getMilestoneNames

public java.util.List getMilestoneNames(java.lang.String product)
                                 throws JagzillaException
Description copied from interface: SystemQuery
gets a list of milestone names for the given product.

Specified by:
getMilestoneNames in interface SystemQuery
Parameters:
product -
Returns:
Throws:
JagzillaException

getProfiles

public java.util.List getProfiles()
                           throws JagzillaException
Description copied from interface: SystemQuery
gets all profiles in database.

Specified by:
getProfiles in interface SystemQuery
Returns:
a List containing a Profile in each entry.
Throws:
JagzillaException - if an error occurs
See Also:
Profile

getProfile

public Profile getProfile(int userId)
                   throws JagzillaException
Description copied from interface: SystemQuery
gets the profile for a given user id.

Specified by:
getProfile in interface SystemQuery
Parameters:
userId -
Returns:
the Profile
Throws:
JagzillaException - if an error occurs
See Also:
Profile

finalize

public void finalize()

getAllComponents

public java.util.List getAllComponents()
                                throws JagzillaException
Description copied from interface: SystemQuery
gets a list of all components in the system regardless of which product they belong to.

Specified by:
getAllComponents in interface SystemQuery
Returns:
Throws:
JagzillaException
See Also:
Component

getUserId

public int getUserId(java.lang.String login)
              throws JagzillaException,
                     NoSuchProfileException,
                     InconsistencyException
Description copied from interface: SystemQuery
gets the id of the user given it's login.

Specified by:
getUserId in interface SystemQuery
Parameters:
login - the user login to search
Returns:
the user id
Throws:
JagzillaException - if an error occurs
InconsistencyException - if there is more than one user with the specified login
NoSuchProfileException - if there is no user with the specified login

addCc

public void addCc(int bugId,
                  int profileId)
           throws JagzillaException,
                  NoSuchBugException,
                  NoSuchProfileException
Description copied from interface: SystemQuery
adds a profile to the cc list of a bug.

Specified by:
addCc in interface SystemQuery
Parameters:
bugId - id of the bug
profileId - id of the profile to be added to the cclist
Throws:
NoSuchProfileException - if the profile id cannot be found
JagzillaException - if an error occurs
NoSuchBugException - if the bug cannot be found

removeCc

public void removeCc(int bugId,
                     int profileId)
              throws JagzillaException,
                     NoSuchBugException,
                     NoSuchProfileException
Description copied from interface: SystemQuery
removes a profile from the cc list of a bug.

Specified by:
removeCc in interface SystemQuery
Parameters:
bugId - id of the bug
profileId - id of the profile to be added to the cclist
Throws:
NoSuchProfileException - if the profile id cannot be found
NoSuchBugException - if the bug cannot be found
JagzillaException - if an error occurs

getBugQuery

public BugQuery getBugQuery()
                     throws JagzillaException
Description copied from interface: SystemQuery
gets an instance of the BugQuery with transport configuration of actual implementation.

Specified by:
getBugQuery in interface SystemQuery
Returns:
an instance of BugQuery
Throws:
JagzillaException - if an error occurs
See Also:
BugQuery


Distributed under the GPL. By Miguel Griffa. See the Jagzilla project page for more info.