|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.borg.model.db.jdbc.JdbcDB
net.sf.borg.model.db.jdbc.JdbcBeanDB<Task>
net.sf.borg.model.db.jdbc.TaskJdbcDB
public class TaskJdbcDB
this is the JDBC layer for access to the task table.
| Field Summary |
|---|
| Fields inherited from class net.sf.borg.model.db.jdbc.JdbcDB |
|---|
connection_ |
| Constructor Summary | |
|---|---|
TaskJdbcDB()
|
|
| Method Summary | |
|---|---|
void |
addLog(int taskid,
String desc)
Adds a task log for a task. |
void |
addObj(Task task)
Adds a KeyedEntity to the database |
void |
addProject(Project p)
Adds a project to the db. |
void |
addSubTask(Subtask s)
Adds a sub task. |
(package private) Task |
createFrom(ResultSet r)
Fills in an entity from a result set |
void |
delete(int key)
Delete a KeyedEntity from the database |
void |
deleteProject(int id)
Delete a project by id |
void |
deleteSubTask(int id)
Delete a sub task by id. |
Collection<Integer> |
getKeys()
Gets the keys. |
Collection<Tasklog> |
getLogs()
Gets all task logs in the db. |
Collection<Tasklog> |
getLogs(int taskid)
Gets all task logs for a given task. |
Project |
getProject(int projectid)
Gets a project by id. |
Collection<Project> |
getProjects()
Gets all projects in the database. |
(package private) PreparedStatement |
getPSAll()
|
(package private) PreparedStatement |
getPSOne(int key)
|
Collection<Project> |
getSubProjects(int projectid)
Gets all sub projects (child projects) for a given project. |
Subtask |
getSubTask(int id)
Gets a sub task by subtask id. |
Collection<Subtask> |
getSubTasks()
Gets all sub tasks in the database. |
Collection<Subtask> |
getSubTasks(int taskid)
Gets all sub tasks for a given task. |
Collection<Task> |
getTasks(int projectid)
Gets all tasks for a given project. |
Task |
newObj()
Return a new instance of the KeyedEntity |
int |
nextkey()
get the next available key value for this entity type |
int |
nextProjectKey()
get the Next available project key. |
int |
nextSubTaskKey()
get the Next available sub task key. |
void |
saveLog(Tasklog tlog)
Save a task log in the db. |
void |
updateObj(Task task)
Update a KeyedEntity in the database |
void |
updateProject(Project s)
Updates a project in the db. |
void |
updateSubTask(Subtask s)
Update a sub task. |
| Methods inherited from class net.sf.borg.model.db.jdbc.JdbcBeanDB |
|---|
delCache, emptyCache, readAll, readCache, readObj, sync, writeCache |
| Methods inherited from class net.sf.borg.model.db.jdbc.JdbcDB |
|---|
beginTransaction, buildDbDir, close, commitTransaction, connect, execSQL, getConnection, getOption, getOptions, getUrl, rollbackTransaction, setOption, toInt, toInt, toStr, toVect |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface net.sf.borg.model.db.EntityDB |
|---|
readAll, readObj, sync |
| Constructor Detail |
|---|
public TaskJdbcDB()
| Method Detail |
|---|
public void addObj(Task task)
throws Exception
EntityDB
addObj in interface EntityDB<Task>task - the KeyedEntity
Exception
public void delete(int key)
throws Exception
EntityDB
delete in interface EntityDB<Task>key - the key of the entity
Exception
public Collection<Integer> getKeys()
throws Exception
Exception - the exception
public int nextkey()
throws Exception
EntityDB
nextkey in interface EntityDB<Task>Exceptionpublic Task newObj()
EntityDB
newObj in interface EntityDB<Task>
PreparedStatement getPSOne(int key)
throws SQLException
getPSOne in class JdbcBeanDB<Task>SQLException
PreparedStatement getPSAll()
throws SQLException
getPSAll in class JdbcBeanDB<Task>SQLException
Task createFrom(ResultSet r)
throws SQLException
JdbcBeanDB
createFrom in class JdbcBeanDB<Task>r - the result set
SQLException
public void updateObj(Task task)
throws Exception
EntityDB
updateObj in interface EntityDB<Task>task - the KeyedEntity
Exception
public Collection<Subtask> getSubTasks(int taskid)
throws SQLException
TaskDB
getSubTasks in interface TaskDBtaskid - the taskid
SQLException
public Collection<Subtask> getSubTasks()
throws SQLException
TaskDB
getSubTasks in interface TaskDBSQLException
public Subtask getSubTask(int id)
throws SQLException
TaskDB
getSubTask in interface TaskDBid - the id
SQLException
public void deleteSubTask(int id)
throws SQLException
TaskDB
deleteSubTask in interface TaskDBid - the id
SQLException
public void addSubTask(Subtask s)
throws SQLException
TaskDB
addSubTask in interface TaskDBs - the subtask
SQLException
public void updateSubTask(Subtask s)
throws SQLException
TaskDB
updateSubTask in interface TaskDBs - the subtask
SQLException
public int nextSubTaskKey()
throws Exception
TaskDB
nextSubTaskKey in interface TaskDBException - the exception
public void addLog(int taskid,
String desc)
throws SQLException
TaskDB
addLog in interface TaskDBtaskid - the task iddesc - the log text
SQLException
public void saveLog(Tasklog tlog)
throws SQLException
TaskDB
saveLog in interface TaskDBtlog - the task log object
SQLException
public Collection<Tasklog> getLogs(int taskid)
throws SQLException
TaskDB
getLogs in interface TaskDBtaskid - the task id
SQLException
public Collection<Tasklog> getLogs()
throws SQLException
TaskDB
getLogs in interface TaskDBSQLException
public void addProject(Project p)
throws SQLException
TaskDB
addProject in interface TaskDBp - the project
SQLException
public void deleteProject(int id)
throws SQLException
TaskDB
deleteProject in interface TaskDBid - the project id
SQLException
public Project getProject(int projectid)
throws SQLException
TaskDB
getProject in interface TaskDBprojectid - the project id
SQLException
public Collection<Project> getProjects()
throws SQLException
TaskDB
getProjects in interface TaskDBSQLException
public Collection<Task> getTasks(int projectid)
throws SQLException
TaskDB
getTasks in interface TaskDBprojectid - the project id
SQLException
public Collection<Project> getSubProjects(int projectid)
throws SQLException
TaskDB
getSubProjects in interface TaskDBprojectid - the project id
SQLException
public int nextProjectKey()
throws Exception
TaskDB
nextProjectKey in interface TaskDBException - the exception
public void updateProject(Project s)
throws SQLException
TaskDB
updateProject in interface TaskDBs - the project
SQLException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||