Class DatabaseConfig
java.lang.Object
edu.ntnu.idatt2106_2023_06.backend.config.DatabaseConfig
This is a Configuration class for Database Initialization.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
DatabaseConfig
public DatabaseConfig()
-
-
Method Details
-
init
@PostConstruct public void init()This method initializes the database triggers. The first of which is used to respond to a user being deleted. When a user is deleted, the corresponding FridgeMember is also deleted and ultimately, the fridge if possible. The second trigger sets the user value to null in the stats table when deleted. The third trigger deletes a fridge if the last superuser is deleted. The fourth trigger sets the fridge value to null in the stats table when fridge is deleted.
-