Interface IdDatabaseTransactionType
- All Superinterfaces:
AutoCloseable
A database transaction. If the transaction is closed, it is automatically
rolled back.
-
Method Summary
Modifier and TypeMethodDescriptionadminId()voidadminIdSet(UUID adminId) Set the admin ID for the transaction.voidclose()voidcommit()Commit the transaction.Determine the executor ID.<T extends IdDatabaseQueriesType>
TObtain queries for the transaction.voidrollback()Roll back the transaction.userId()voidSet the user ID for the transaction.
-
Method Details
-
close
- Specified by:
closein 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
-