Host
Service
Events
Repository
The HostServiceEventsRepository
interface is useful to manage the queries of the ServiceEvent
Author
N7ghtm4r3 - Tecknobit
See also
JpaRepository
Functions
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@Query(value = ""SELECT MAX(" + EVENT_DATE_KEY + ") FROM " + SERVICE_EVENTS_KEY +
_WHERE_ + TYPE_KEY + " IN ('RUNNING', 'RESTARTED') AND " +
SERVICE_IDENTIFIER_KEY + "=:" + SERVICE_IDENTIFIER_KEY",
nativeQuery = true
)
Query used to get the last RUNNING
event
Link copied to clipboard
Link copied to clipboard
@Modifying(clearAutomatically = true
)
@Query(value = "INSERT INTO " + SERVICE_EVENTS_KEY + " (" +
IDENTIFIER_KEY + "," +
TYPE_KEY + "," +
EVENT_DATE_KEY + "," +
SERVICE_IDENTIFIER_KEY + ") VALUES (" +
":" + IDENTIFIER_KEY + "," +
":" + TYPE_KEY + "," +
":" + EVENT_DATE_KEY + "," +
":" + SERVICE_IDENTIFIER_KEY + ")",
nativeQuery = true
)
@Modifying(clearAutomatically = true
)
@Query(value = "INSERT INTO " + SERVICE_EVENTS_KEY + " (" +
IDENTIFIER_KEY + "," +
TYPE_KEY + "," +
EVENT_DATE_KEY + "," +
EXTRA_KEY + "," +
SERVICE_IDENTIFIER_KEY + ") VALUES (" +
":" + IDENTIFIER_KEY + "," +
":" + TYPE_KEY + "," +
":" + EVENT_DATE_KEY + "," +
":" + EXTRA_KEY + "," +
":" + SERVICE_IDENTIFIER_KEY + ")",
nativeQuery = true
)
Query used to register a new event
Link copied to clipboard
Link copied to clipboard