com.knowgate.projtrack
Class Bug

java.lang.Object
  extended bycom.knowgate.dataobjs.DBPersist
      extended bycom.knowgate.projtrack.Bug
All Implemented Interfaces:
java.util.Map

public class Bug
extends DBPersist

Bug or Project Incident

Version:
3.0

Nested Class Summary
 
Nested classes inherited from class java.util.Map
java.util.Map.Entry
 
Field Summary
static short ClassId
           
 
Fields inherited from class com.knowgate.dataobjs.DBPersist
AllVals, sAuditCls, sAuditUsr, sTransactId
 
Constructor Summary
Bug()
          Create empty bug
Bug(JDCConnection oConn, java.lang.String sIdBug)
          Load Bug from database.
 
Method Summary
 void attachFile(JDCConnection oConn, java.lang.String sFilePath)
          Insert attachment into k_bugs_attach table
 BugAttachment[] attachments(JDCConnection oConn)
          Get array of attachments
 boolean delete(JDCConnection oConn)
          Delete Bug.
static boolean delete(JDCConnection oConn, java.lang.String sBugGUID)
          Delete Bug.
static java.lang.String getIdFromPg(JDCConnection oConn, int iBugPg, java.lang.String sWorkArea)
          Get Bug Unique Identifier from its numeric identifier.
static int getPgFromId(JDCConnection oConn, java.lang.String sBugId)
          Get Bug Numeric Identifier from Global Unique Identifier.
 void removeAttachment(JDCConnection oConn, java.lang.String sFileName)
          Remove attachment from k_bugs_attach table
 boolean store(JDCConnection oConn)
          Store Bug and write its change log
 
Methods inherited from class com.knowgate.dataobjs.DBPersist
allcaps, allcaps, changelog, clear, clone, containsKey, containsValue, entrySet, exists, get, get, getAuditClassName, getCreationDate, getDate, getDateFormated, getDateShort, getDecimal, getDecimalFormated, getDouble, getDoubleFormated, getFloat, getFloatFormated, getInt, getInteger, getItemMap, getItems, getShort, getString, getStringNull, getTable, getTable, getTableName, getTime, getTimeOfDay, getTimestamp, getUIdFromName, isEmpty, isNull, iterator, keySet, load, load, parseXML, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, putAll, putAll, remove, remove, replace, replace, replace, replace, setAuditTransact, setAuditUser, size, toLowerCase, toUpperCase, toXML, toXML, toXML, values
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Field Detail

ClassId

public static final short ClassId
See Also:
Constant Field Values
Constructor Detail

Bug

public Bug()
Create empty bug


Bug

public Bug(JDCConnection oConn,
           java.lang.String sIdBug)
    throws java.sql.SQLException
Load Bug from database.

Parameters:
oConn - Database Connection
sIdBug - GUID of Bug to be loaded.
Throws:
java.sql.SQLException
Method Detail

delete

public boolean delete(JDCConnection oConn)
               throws java.sql.SQLException

Delete Bug.

Calls k_sp_del_bug stored procedure.

Overrides:
delete in class DBPersist
Parameters:
oConn - Database Connection
Returns:
true if register was successfully erased, false if not.
Throws:
java.sql.SQLException

store

public boolean store(JDCConnection oConn)
              throws java.sql.SQLException

Store Bug and write its change log

This method automatically assigns a new bug number (pg_bug) if one is not supplied by calling seq_k_bugs sequence It also updates last modified date (dt_modified) and sinve v2.2 writes changes to k_bugs_changelog if that table exists

Overrides:
store in class DBPersist
Parameters:
oConn - JDCConnection
Returns:
boolean
Throws:
java.sql.SQLException

attachFile

public void attachFile(JDCConnection oConn,
                       java.lang.String sFilePath)
                throws java.sql.SQLException,
                       java.io.FileNotFoundException,
                       java.io.IOException,
                       java.lang.NullPointerException
Insert attachment into k_bugs_attach table

Parameters:
oConn - JDCConnection
sFilePath - String Full path to local file
Throws:
java.sql.SQLException
java.io.FileNotFoundException
java.io.IOException
java.lang.NullPointerException
Since:
3.0

removeAttachment

public void removeAttachment(JDCConnection oConn,
                             java.lang.String sFileName)
                      throws java.sql.SQLException
Remove attachment from k_bugs_attach table

Parameters:
oConn - JDCConnection
sFileName - String
Throws:
java.sql.SQLException

attachments

public BugAttachment[] attachments(JDCConnection oConn)
                            throws java.sql.SQLException
Get array of attachments

Parameters:
oConn - JDCConnection
Returns:
BugAttachment[] Array of BugAttachment objects or null if this Bug has no attachments
Throws:
java.sql.SQLException
Since:
3.0

delete

public static boolean delete(JDCConnection oConn,
                             java.lang.String sBugGUID)
                      throws java.sql.SQLException

Delete Bug.

Typically, bugs are never deleted, but their status is changed to some definitive solved or archived condition.
Calls k_sp_del_bug stored procedure.

Parameters:
oConn - Database Connection
sBugGUID - GUID of Bug to be deleted.
Throws:
java.sql.SQLException

getPgFromId

public static int getPgFromId(JDCConnection oConn,
                              java.lang.String sBugId)
                       throws java.sql.SQLException

Get Bug Numeric Identifier from Global Unique Identifier.

Each Bug is assigned a GUID. But, as GUID are 32 characters hexadecimals string very difficult to remember, each bug is also automatically assigned to an integer identifier. The bug numeric identifier is an alternative primary key.

Parameters:
oConn - Database Connection
sBugId - Bug GUID
Returns:
Bug Integer Identifier
Throws:
java.sql.SQLException

getIdFromPg

public static java.lang.String getIdFromPg(JDCConnection oConn,
                                           int iBugPg,
                                           java.lang.String sWorkArea)
                                    throws java.sql.SQLException

Get Bug Unique Identifier from its numeric identifier.

Each Bug is assigned a GUID. But, as GUID are 32 characters hexadecimals string very difficult to remember, each bug is also automatically assigned to an integer identifier. The bug numeric identifier is an alternative primary key.

Parameters:
oConn - Database Connection
iBugPg - Bug numeric identifier
sWorkArea - GUID
Returns:
Bug GUID or null if no bug with such numeric identifier is found at given WorkArea
Throws:
java.sql.SQLException
Since:
2.2