fi.paatti.paattidatabaseutils.dbservice
Interface PaattiMobileDBService

All Known Implementing Classes:
PaattiDBService

public interface PaattiMobileDBService

The interface for the mobile client.

Author:
Lauri Satokangas, lauri.n.satokangas@student.jyu.fi, Tapio Keränen, t.tapio.keranen@student.jyu.fi
 

Method Summary
 Object getCellValueFromTable(String tableName, String columnName, String IDColumn, Object rowID)
          Returns the value of the given column.
 com.vaadin.data.util.sqlcontainer.SQLContainer getChoiceContainer(Object eventID)
          Returns all the choices that belong to the event with the given id.
 com.vaadin.data.util.sqlcontainer.SQLContainer getGroupUsers(Object groupID)
          Returns all the users that belong to the group with the given id.
 com.vaadin.data.util.sqlcontainer.SQLContainer getSQLContainerFromDBTable(String tableName, String nameOfIDColumn, boolean noDeletedRows)
          Queries the database for the given table and returns an SQLContainer containing the query results.
 com.vaadin.data.util.sqlcontainer.SQLContainer getSQLContainerFromDBTableFiltered(String tableName, String nameOfIDColumn, boolean noDeletedRows, com.vaadin.data.Container.Filter filter)
          Queries the database for the given table and returns an SQLContainer containing the query results.
 com.vaadin.data.util.sqlcontainer.SQLContainer getTaskContainer(Object eventID)
          Returns all the tasks that belong to the event with the given id.
 com.vaadin.data.util.sqlcontainer.SQLContainer getUserEventData(Object userId)
          Returns the event data from the user's finished events.
 com.vaadin.data.util.sqlcontainer.SQLContainer getUserUnfinishedEvents(Object userID)
          Returns all the available events for the user.
 com.vaadin.data.util.sqlcontainer.SQLContainer getUserVoluntaryEvents(Object userID)
          Returns all the voluntary events that are assigned to the user.
 boolean saveEventTaskData(Object userID, Stack<TaskData> taskDataStack)
          Saves all the data from a single event.
 

Method Detail

getSQLContainerFromDBTable

com.vaadin.data.util.sqlcontainer.SQLContainer getSQLContainerFromDBTable(String tableName,
                                                                          String nameOfIDColumn,
                                                                          boolean noDeletedRows)
Queries the database for the given table and returns an SQLContainer containing the query results.

SHOULD NOT BE USED FOR DELETING ROWS! (instead, just change the row status to 'DELETED'.

Parameters:
tableName - the name of the table.
nameOfIDColumn - the name of the id column.
noDeletedRows - whether to filter deleted rows or not.
Returns:
SQLContainer containing the items from the given table.

getSQLContainerFromDBTableFiltered

com.vaadin.data.util.sqlcontainer.SQLContainer getSQLContainerFromDBTableFiltered(String tableName,
                                                                                  String nameOfIDColumn,
                                                                                  boolean noDeletedRows,
                                                                                  com.vaadin.data.Container.Filter filter)
Queries the database for the given table and returns an SQLContainer containing the query results. The given filter (if any) will be applied to the SQLContainer to exclude rows from the results.

SHOULD NOT BE USED FOR DELETING ROWS! (instead, just change the row status to 'DELETED'.

Parameters:
tableName - the name of the table.
nameOfIDColumn - the name of the ID column
noDeletedRows - whether to filter deleted rows or not.
filter - the filter to be used.
Returns:
SQLContainer containing all the items from the given table.

getCellValueFromTable

Object getCellValueFromTable(String tableName,
                             String columnName,
                             String IDColumn,
                             Object rowID)
Returns the value of the given column.

Parameters:
tableName - the name of the table the column belongs to.
columnName - the name of the column.
IDColumn - the ID column of the table.
rowID - the ID of the row where the value will be taken from.
Returns:
The found value or null if none found.

saveEventTaskData

boolean saveEventTaskData(Object userID,
                          Stack<TaskData> taskDataStack)
Saves all the data from a single event.

Parameters:
userID - the ID of the user.
taskDataStack - the list of TaskData items.
Returns:
True if successful, otherwise false.

getUserUnfinishedEvents

com.vaadin.data.util.sqlcontainer.SQLContainer getUserUnfinishedEvents(Object userID)
Returns all the available events for the user.

Parameters:
userID - the ID of the user.
Returns:
SQLContainer containing all the available events.

getTaskContainer

com.vaadin.data.util.sqlcontainer.SQLContainer getTaskContainer(Object eventID)
Returns all the tasks that belong to the event with the given id.

Parameters:
eventID - the ID of the event.
Returns:
SQLContainer containing all the tasks of the event.

getChoiceContainer

com.vaadin.data.util.sqlcontainer.SQLContainer getChoiceContainer(Object eventID)
Returns all the choices that belong to the event with the given id.

Parameters:
eventID - the ID of the event.
Returns:
SQLContainer containing all the choices of the event.

getGroupUsers

com.vaadin.data.util.sqlcontainer.SQLContainer getGroupUsers(Object groupID)
Returns all the users that belong to the group with the given id.

Parameters:
groupID - the ID of the group.
Returns:
SQLContainer containing the members of the group.

getUserVoluntaryEvents

com.vaadin.data.util.sqlcontainer.SQLContainer getUserVoluntaryEvents(Object userID)
Returns all the voluntary events that are assigned to the user.

Parameters:
userID - the ID of the user.
Returns:
SQLContainer containing the voluntary events.

getUserEventData

com.vaadin.data.util.sqlcontainer.SQLContainer getUserEventData(Object userId)
Returns the event data from the user's finished events.

Parameters:
userId - the ID of the user.
Returns:
SQLContainer containing the event data.


Copyright © 2012. All Rights Reserved.