/tests/com/google/appengine/datanucleus/test/HasTimestampVersionJPA.java

http://datanucleus-appengine.googlecode.com/ · Java · 55 lines · 28 code · 9 blank · 18 comment · 0 complexity · c26249c37dff17a9038bc087f2685df1 MD5 · raw file

  1. /**********************************************************************
  2. Copyright (c) 2009 Google Inc.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. **********************************************************************/
  13. package com.google.appengine.datanucleus.test;
  14. import java.sql.Timestamp;
  15. import javax.persistence.Entity;
  16. import javax.persistence.GeneratedValue;
  17. import javax.persistence.GenerationType;
  18. import javax.persistence.Id;
  19. import javax.persistence.Version;
  20. /**
  21. * @author Max Ross <maxr@google.com>
  22. */
  23. @Entity
  24. public class HasTimestampVersionJPA {
  25. @Id
  26. @GeneratedValue(strategy=GenerationType.IDENTITY)
  27. private Long id;
  28. private String value;
  29. @Version
  30. private Timestamp version;
  31. public String getValue() {
  32. return value;
  33. }
  34. public void setValue(String value) {
  35. this.value = value;
  36. }
  37. public Long getId() {
  38. return id;
  39. }
  40. public Timestamp getVersion() {
  41. return version;
  42. }
  43. }