@Target(value=METHOD) @Retention(value=RUNTIME) @Documented public @interface Timestamped
:now or a custom named parameter with
the current DateTime as an OffsetDateTime.
Common use cases:
public interface PersonDAO {
@SqlUpdate("INSERT INTO people(id, firstName, lastName, email, created, modified) VALUES (:p.id, :p.firstName, :p.lastName, :p.email, :now, :now)")
@Timestamped
@GetGeneratedKeys
int insert(@BindBean("p") Person person);
@SqlUpdate("UPDATE people SET modified = :now, firstName = :p.firstName, lastName = :p.lastName, email = :p.email WHERE id = :p.id")
@Timestamped
void update(@BindBean("p") Person person);
}
TimestampedConfigpublic abstract String value
now
and can be changed to customize the parameter bound to the current DateTime.Copyright © 2019. All rights reserved.