|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectnet.sf.jagzilla.BaseQuery
base class to provide helper methods. This class is a holder for common code among jagzilla API implementations. This is only usefull for classes using the hibernate access api.
There are three kind of helper methods in this class
| Field Summary | |
protected EventHandler |
eventHandler
|
protected java.util.Properties |
hibernateProperties
|
protected Session |
session
|
protected static SessionFactory |
sessionFactory
|
| Constructor Summary | |
BaseQuery()
|
|
| Method Summary | |
protected boolean |
bugExists(int id)
tells if the given bug exists. |
protected boolean |
componentExists(java.lang.String string)
tells if the given components exists. |
protected void |
continueIfProductExists(java.lang.String product)
validates the existance of product and throws NoSuchProductException if it does not exits. |
protected void |
continueIfResolutionExists(java.lang.String resolution)
helper method for resolution parameter validation. |
protected void |
continueIfStatusExists(java.lang.String status)
helper method for status parameter validation. |
protected void |
continueIfUsersExists(int profileId)
validate a profile and throw exceptions on error or do nothing on sucess. |
protected EventHandler |
getEventHandler()
gets the event handler. |
protected int |
getFieldId(java.lang.String field)
gets the field id of a given field name. |
Session |
getNewSession()
returns a new Hibernate session. |
protected Bug |
locateBug(int id)
helper method for validating a bug. |
protected Component |
locateComponent(java.lang.String name)
helper method for validating a component. |
protected Product |
locateProduct(java.lang.String name)
Helper method for locating and validating a product. |
protected Profile |
locateProfile(int id)
helper method for validating a profile. |
protected boolean |
milestoneExists(java.lang.String id)
tells if the given milestone exists. |
protected boolean |
priorityExists(java.lang.String pri)
tells if the given priority exists. |
protected boolean |
productExists(java.lang.String id)
tells if the given product exists. |
protected int |
queryCountValue(java.lang.String qry)
count the results in an hibernate query. |
protected boolean |
resolutionExists(java.lang.String resolution)
tells if the given resolution exists. |
void |
setHibernateProperties(java.util.Properties p)
sets the hibernate properties to use. |
protected boolean |
severityExists(java.lang.String sev)
tells if the given severity exists. |
protected boolean |
statusExists(java.lang.String status)
tells if the given status exists. |
protected boolean |
userExists(int id)
tells if the given user(Profile) exists. |
protected boolean |
versionExists(java.lang.String id)
tells if the given version exists. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected Session session
protected static SessionFactory sessionFactory
protected java.util.Properties hibernateProperties
protected EventHandler eventHandler
| Constructor Detail |
public BaseQuery()
| Method Detail |
protected EventHandler getEventHandler()
public void setHibernateProperties(java.util.Properties p)
p - properties to use
protected int queryCountValue(java.lang.String qry)
throws HibernateException
qry - the hibernate query to count
HibernateException - if an error occurs
public Session getNewSession()
throws HibernateException
HibernateException - if an error occurs
protected boolean componentExists(java.lang.String string)
throws HibernateException
string - the component to query
HibernateException - if an error occurs
protected boolean milestoneExists(java.lang.String id)
throws HibernateException
id - of the milestone to query
HibernateException - if an error occurs
protected boolean userExists(int id)
throws HibernateException
id - of the user to query
HibernateException - if an error occurs
protected boolean productExists(java.lang.String id)
throws HibernateException
id - of the product to query
HibernateException - if an error occurs
protected boolean bugExists(int id)
throws HibernateException
id - of the bug to query
HibernateException - if an error occurs
protected boolean versionExists(java.lang.String id)
throws HibernateException
id - of the version to query
HibernateException - if an error occurs
protected void continueIfProductExists(java.lang.String product)
throws JagzillaException,
NoSuchProductException
product and throws NoSuchProductException if it does not exits.
product -
JagzillaException - if an error occurs
NoSuchProductException - if the product cannot be found
protected void continueIfUsersExists(int profileId)
throws JagzillaException,
NoSuchProfileException
profileId - id of the profile to validate
JagzillaException - if an error occurs
NoSuchProfileException - if the given profile cannot be foundprotected boolean statusExists(java.lang.String status)
status - of the status to query
protected boolean severityExists(java.lang.String sev)
sev - of the severity to query
protected boolean priorityExists(java.lang.String pri)
pri - of the priority to query
protected boolean resolutionExists(java.lang.String resolution)
resolution - of the resolution to query
protected void continueIfStatusExists(java.lang.String status)
throws BadStatusException
status - the status to validate
BadStatusException - if the status is invalid
protected void continueIfResolutionExists(java.lang.String resolution)
throws BadResolutionException
resolution - the resolution to validate
BadResolutionException - if the resolution is invalid
protected int getFieldId(java.lang.String field)
throws HibernateException,
JagzillaException
field - name of the field to search
HibernateException - if an error occurs
JagzillaException - if result set is smaller than 1, meaning the field was not found
protected Component locateComponent(java.lang.String name)
throws NoSuchComponentException,
ComponentNotUniqueException,
JagzillaException
name - of the component to locate
NoSuchComponentException - if the component cannot be found
ComponentNotUniqueException - if there is more than one component with the given name
JagzillaException - if an error occurs
protected Product locateProduct(java.lang.String name)
throws NoSuchProductException,
JagzillaException
name - the product to locate
NoSuchProductException - if the product cannot be found
JagzillaException - if an error occurs
protected Bug locateBug(int id)
throws NoSuchBugException,
JagzillaException
id - the if of the bug to locate
NoSuchBugException - if the bug cannot be found
JagzillaException - if an error occurs
protected Profile locateProfile(int id)
throws NoSuchProfileException,
JagzillaException
id - the id of the profile to locate
NoSuchProfileException - if the profile cannot be found
JagzillaException - if an error occurs
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||