Tweaked how the version is exposed. It isn't by default so I added a check for @RestResource on the version attribute. If a path is set, the version is exported under that name.
This commit is contained in:
@@ -14,6 +14,7 @@ import javax.persistence.PrePersist;
|
||||
import javax.persistence.Version;
|
||||
|
||||
import org.codehaus.jackson.annotate.JsonManagedReference;
|
||||
import org.springframework.data.rest.repository.annotation.RestResource;
|
||||
|
||||
/**
|
||||
* @author Jon Brisbin <jbrisbin@vmware.com>
|
||||
@@ -23,6 +24,7 @@ public class Person {
|
||||
|
||||
@Id @GeneratedValue private Long id;
|
||||
private String name;
|
||||
@RestResource(path = "version")
|
||||
@Version
|
||||
private Long version;
|
||||
@JsonManagedReference
|
||||
|
||||
Reference in New Issue
Block a user