Host
Events
Repository
The HostEventsRepository interface is
useful to manage the queries of the HostHistoryEvent
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 " + HOST_EVENTS_KEY +
_WHERE_ + TYPE_KEY + " IN ('ONLINE', 'RESTARTED') AND " +
HOST_IDENTIFIER_KEY + "=:" + HOST_IDENTIFIER_KEY",
nativeQuery = true
)
Query used to get the last ONLINE
event
Link copied to clipboard
Link copied to clipboard
@Modifying(clearAutomatically = true
)
@Query(value = "INSERT INTO " + HOST_EVENTS_KEY + " (" +
IDENTIFIER_KEY + "," +
TYPE_KEY + "," +
EVENT_DATE_KEY + "," +
HOST_IDENTIFIER_KEY + ") VALUES (" +
":" + IDENTIFIER_KEY + "," +
":" + TYPE_KEY + "," +
":" + EVENT_DATE_KEY + "," +
":" + HOST_IDENTIFIER_KEY + ")",
nativeQuery = true
)
@Modifying(clearAutomatically = true
)
@Query(value = "INSERT INTO " + HOST_EVENTS_KEY + " (" +
IDENTIFIER_KEY + "," +
TYPE_KEY + "," +
EVENT_DATE_KEY + "," +
EXTRA_KEY + "," +
HOST_IDENTIFIER_KEY + ") VALUES (" +
":" + IDENTIFIER_KEY + "," +
":" + TYPE_KEY + "," +
":" + EVENT_DATE_KEY + "," +
":" + EXTRA_KEY + "," +
":" + HOST_IDENTIFIER_KEY + ")",
nativeQuery = true
)
Query used to register a new event
Link copied to clipboard
Link copied to clipboard