Package com.io7m.idstore.database.api
Interface IdDatabaseTransactionType
- All Superinterfaces:
AutoCloseable
A database transaction. If the transaction is closed, it is automatically
rolled back.
-
Method Summary
Modifier and TypeMethodDescriptionadminId()
void
adminIdSet
(UUID adminId) Set the admin ID for the transaction.void
close()
void
commit()
Commit the transaction.Determine the executor ID.<T extends IdDatabaseQueriesType>
TObtain queries for the transaction.void
rollback()
Roll back the transaction.userId()
void
Set the user ID for the transaction.
-
Method Details
-
close
- Specified by:
close
in interfaceAutoCloseable
- Throws:
IdDatabaseException
-
queries
Obtain queries for the transaction.- Type Parameters:
T
- The query type- Parameters:
queryClass
- The query type- Returns:
- Queries
- Throws:
IdDatabaseException
- On errors
-
rollback
Roll back the transaction.- Throws:
IdDatabaseException
- On errors
-
commit
Commit the transaction.- Throws:
IdDatabaseException
- On errors
-
userIdSet
Set the user ID for the transaction. This is the ID that will typically end up in audit events.- Parameters:
userId
- The user ID- Throws:
IdDatabaseException
- On errors
-
userId
- Returns:
- The current user ID
- Throws:
IdDatabaseException
- On errors
-
adminIdSet
Set the admin ID for the transaction. This is the ID that will typically end up in audit events.- Parameters:
adminId
- The admin ID- Throws:
IdDatabaseException
- On errors
-
adminId
- Returns:
- The current admin ID
- Throws:
IdDatabaseException
- On errors
-
executorId
Determine the executor ID. This is the value set by whichever ofadminIdSet(UUID)
oruserIdSet(UUID)
has been called most recently.- Returns:
- The current executor ID
- Throws:
IdDatabaseException
- On errors
-