I am using Timestamp with now = LocalDateTime.now()
with Native Query and update
and later I am using the same now
variable to select
from database. MS SQL. I am using this Java Spring Boot. In a Repository. I hope this is enough explanation and code otherwise I can try do some more description. Thank you for all the info.
@Modifying
@Transactional
@Query(value = "UPDATE xy SET ts = :timestamp", nativeQuery = true)
void update(LocalDateTime timestamp);
@Query(value = "SELECT * FROM xy WHERE ts = :timestamp", nativeQuery = true)
List<List<String>> select(LocalDateTime timestamp);
// and then I call
LocalDateTime now = LocalDateTime.now();
update(now);
list = select(now);
// and the list is empty