|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IDbWriteAccess
Database read access object.
Field Summary | |
---|---|
static int |
ALREADY_EXISTS
Result already exists. |
static int |
FAILED
Unsuccessful write status. |
static int |
NO_DATA
Query/ update returned no data. |
static int |
SUCCESS
Successful write status. |
Method Summary | |
---|---|
void |
createIndex(DbTable table,
String column)
Create index on a table column. |
boolean |
createTable(DbTable table)
Create a new table in the database. |
boolean |
deleteConstituency(String constituencyName,
char type,
String parentName)
Delete a constituency from the database. |
boolean |
insertCandidate(Candidate candidate)
Insert a new Candidate into the database. |
boolean |
insertConstituency(String constituencyName,
char type,
String parentName)
Insert a new constituency into the database. |
boolean |
insertConstituency(String constituencyName,
char type,
String parentName,
boolean isState)
Insert a new constituency into the database. |
boolean |
insertElection(Election election)
Insert a new Election into the database. |
int |
insertElectorate(Constituency constituency,
int electionNo,
int electorate)
Insert the electorate size into the database. |
boolean |
insertParty(String abbreviation,
String name)
Insert a new Party into the database. |
boolean |
insertParty(String abbreviation,
String name,
URL url)
Insert a new Party into the database. |
boolean |
insertPartyLeader(Election election,
Candidate candidate,
Constituency constituency)
Insert a party leader. |
boolean |
insertResult(Vector votes)
Insert a Vector of results into the database. |
boolean |
renameConstituency(String constituencyName,
String newConstituencyName,
char type,
String parentName)
Rename a constituency in the database. |
int |
updateElectorate(Constituency constituency,
int electionNo,
int electorate)
Update the electorate size into the database. |
Methods inherited from interface org.gswing.framework.services.IDbReadAccess |
---|
getCandidateNo, getCandidates, getConstituencies, getConstituency, getConstituency, getElection, getElectionDates, getElections, getElections, getElectorate, getLatestDate, getLeaders, getLeaders, getNextResult, getNoOfCandidates, getNoOfParties, getParties, getParty, getPartyAbbreviation, getPreviousResult, getResult, getVotesCast, partyExists, resultExists, resultExists, tableExists |
Methods inherited from interface org.gswing.components.common.gui.IConstituencyBrowsing |
---|
getConstituencyList, getRegionList, getState |
Field Detail |
---|
static final int SUCCESS
static final int NO_DATA
static final int FAILED
static final int ALREADY_EXISTS
Method Detail |
---|
void createIndex(DbTable table, String column)
table
- The table to create the index on.column
- The column to create the index on.boolean createTable(DbTable table)
table
- The table to create in the database.
boolean insertCandidate(Candidate candidate)
candidate
- The candidate to be inserted.
boolean insertConstituency(String constituencyName, char type, String parentName)
constituencyName
- The constituency to insert.type
- The constituency type - Result.NATIONAL, REGIONAL,
COUNCIL, CONSTITUENCY or LOCAL
parentName
- The constituency's parent. (E.g. National is parent of
Regional, Regional is parent of Constituency, Regional is parent of Council
and Council is the parent of Local)
boolean insertConstituency(String constituencyName, char type, String parentName, boolean isState)
constituencyName
- The constituency to insert.type
- The constituency type - Result.NATIONAL, REGIONAL,
COUNCIL, CONSTITUENCY or LOCAL
parentName
- The constituency's parent. (E.g. National is parent of
Regional, Regional is parent of Constituency, Regional is parent of Council
and Council is the parent of Local)isState
- Is this constituency the top level state / nation?
boolean insertElection(Election election)
election
- The election to insert.int insertElectorate(Constituency constituency, int electionNo, int electorate)
constituency
- The constituency reference.electionNo
- The unique election id.electorate
- The size of electorate for this constituency.
SUCCESS <\code> if electorate inserted successully,
FAILED <\code> if something went wrong and ALREADY_EXISTS
if
the result already exits.
int updateElectorate(Constituency constituency, int electionNo, int electorate)
constituency
- The constituency reference.electionNo
- The unique election id.electorate
- The size of electorate for this constituency.
boolean insertParty(String abbreviation, String name, URL url)
abbreviation
- The candidate to be inserted.name
- Party name.url
- The party's home page.
boolean insertParty(String abbreviation, String name)
abbreviation
- The candidate to be inserted.name
- Party name.
boolean insertPartyLeader(Election election, Candidate candidate, Constituency constituency)
election
- The election.candidate
- The leader as a candidate.constituency
- The constituency object.
boolean insertResult(Vector votes)
votes
- A Vector of vote objects.
boolean deleteConstituency(String constituencyName, char type, String parentName)
constituencyName
- The constituency name.type
- The constituency type - Result.NATIONAL, REGIONAL,
COUNCIL, CONSTITUENCY or LOCAL
parentName
- The constituency's parent. (E.g. National is parent of
Regional, Regional is parent of Constituency, Regional is parent of Council
and Council is the parent of Local)
boolean renameConstituency(String constituencyName, String newConstituencyName, char type, String parentName)
constituencyName
- The old constituency name.newConstituencyName
- The new constituency name.type
- The constituency type - Result.NATIONAL, REGIONAL,
COUNCIL, CONSTITUENCY or LOCAL
parentName
- The constituency's parent. (E.g. National is parent of
Regional, Regional is parent of Constituency, Regional is parent of Council
and Council is the parent of Local)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |