Class PilotWriteDAO
java.lang.Object
org.deltava.dao.DAO
org.deltava.dao.PilotWriteDAO
- Direct Known Subclasses:
SetApplicant
,SetPilot
,SetPilotLogin
,SetPilotMerge
,SetPilotPush
A Data Access Object to support writing Pilot objects to the database.
- Since:
- 1.0
- Version:
- 10.3
- Author:
- Luke
-
Field Summary
Fields inherited from class org.deltava.dao.DAO
_queryMax, _queryStart, _queryTimeout, WGS84_SRID
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Initializes the Data Access Object. -
Method Summary
Modifier and TypeMethodDescriptionvoid
setStatus
(int id, PilotStatus status) Updates a Pilots' status in the database.protected void
writeAlias
(int id, String... aliases) Writes a Pilot's alias to the AUTH_ALIAS table if present.protected void
writeExternalIDs
(int id, Map<ExternalID, String> addrs, String db, boolean doClear) Writes a Pilot's external IDs to the database.protected void
writeRatings
(int id, Collection<String> ratings, String db, boolean doClear) Writes a Pilot's equipment type ratings to the database.protected void
writeRoles
(int id, Collection<Role> roles) Writes a Pilot's security roles to the database.Methods inherited from class org.deltava.dao.DAO
commitTransaction, createTimestamp, executeIDs, executeUpdate, executeUpdate, expandDate, formatDBName, formatLocation, getNewID, getQueryCount, prepare, prepareWithoutLimits, rollbackTransaction, setQueryMax, setQueryStart, setQueryTimeout, startTransaction, toID, toID, toInstant
-
Constructor Details
-
PilotWriteDAO
Initializes the Data Access Object.- Parameters:
c
- the JDBC connection to use
-
-
Method Details
-
writeRoles
Writes a Pilot's security roles to the database.- Parameters:
id
- the Pilot's database IDroles
- a Collection of security role names- Throws:
SQLException
- if a JDBC error occurs
-
writeRatings
protected void writeRatings(int id, Collection<String> ratings, String db, boolean doClear) throws SQLException Writes a Pilot's equipment type ratings to the database.- Parameters:
id
- the Pilot's database IDratings
- a Collection of aircraft typesdb
- the database to write todoClear
- TRUE if existing ratings should be cleared, otherwise FALSE- Throws:
SQLException
- if a JDBC error occurs
-
writeExternalIDs
protected void writeExternalIDs(int id, Map<ExternalID, String> addrs, String db, boolean doClear) throws SQLException Writes a Pilot's external IDs to the database.- Parameters:
id
- the Pilot's database IDaddrs
- a Map of IM addresses, keyed by typedb
- the database to write todoClear
- TRUE if existing ratings should be cleared, otherwise FALSE- Throws:
SQLException
- if a JDBC error occurs
-
writeAlias
Writes a Pilot's alias to the AUTH_ALIAS table if present.- Parameters:
id
- the Pilot's database IDaliases
- an array of aliases- Throws:
SQLException
- if a JDBC error occurs
-
setStatus
Updates a Pilots' status in the database.- Parameters:
id
- the pilot database IDstatus
- the PilotStatus- Throws:
DAOException
- if a JDBC error occurs
-