You are currently browsing legacy 4.1 version of documentation. Click here to switch to the newest 5.0 version.
Session: How to Get Entity Last Modified
When a document is downloaded from the server it contains various metadata information, including the last modified date of the document.
Last modified date is stored within the metadata in session and is available for each entity using the
getLastModifiedFor method from the
advanced session operations.
<T> Date getLastModifiedFor(T instance)
|instance||T||Instance of an entity for which the last modified date will be returned.|
|Date||Returns the last modified date for an entity. Throws an exception if the
Employee employee = session.load(Employee.class, "employees/1-A"); Date lastModified = session.advanced().getLastModifiedFor(employee);