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:
Jon Brisbin
2012-10-15 07:42:02 -04:00
committed by Jon Brisbin
parent d526e073ba
commit 851ae50301
2 changed files with 10 additions and 3 deletions

View File

@@ -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