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

http://datanucleus-appengine.googlecode.com/ · Java · 137 lines · 90 code · 32 blank · 15 comment · 0 complexity · e85dc8ada8ab64d187bcae10d4d53489 MD5 · raw file

  1. /**********************************************************************
  2. Copyright (c) 2011 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 javax.jdo.annotations.IdGeneratorStrategy;
  15. import javax.jdo.annotations.NullValue;
  16. import javax.jdo.annotations.PersistenceCapable;
  17. import javax.jdo.annotations.Persistent;
  18. import javax.jdo.annotations.PrimaryKey;
  19. @PersistenceCapable
  20. public class HasNotNullConstraintsJDO {
  21. @PrimaryKey
  22. @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
  23. private Long id;
  24. @Persistent(nullValue = NullValue.EXCEPTION)
  25. private Boolean bool;
  26. @Persistent(nullValue = NullValue.EXCEPTION)
  27. private Character c;
  28. @Persistent(nullValue = NullValue.EXCEPTION)
  29. private Byte b;
  30. @Persistent(nullValue = NullValue.EXCEPTION)
  31. private Short s;
  32. @Persistent(nullValue = NullValue.EXCEPTION)
  33. private Integer i;
  34. @Persistent(nullValue = NullValue.EXCEPTION)
  35. private Long l;
  36. @Persistent(nullValue = NullValue.EXCEPTION)
  37. private Float f;
  38. @Persistent(nullValue = NullValue.EXCEPTION)
  39. private Double d;
  40. @Persistent(nullValue = NullValue.EXCEPTION)
  41. private String str;
  42. public Boolean getBool() {
  43. return bool;
  44. }
  45. public void setBool(Boolean bool) {
  46. this.bool = bool;
  47. }
  48. public Character getC() {
  49. return c;
  50. }
  51. public void setC(Character c) {
  52. this.c = c;
  53. }
  54. public Byte getB() {
  55. return b;
  56. }
  57. public void setB(Byte b) {
  58. this.b = b;
  59. }
  60. public Short getS() {
  61. return s;
  62. }
  63. public void setS(Short s) {
  64. this.s = s;
  65. }
  66. public Integer getI() {
  67. return i;
  68. }
  69. public void setI(Integer i) {
  70. this.i = i;
  71. }
  72. public Long getL() {
  73. return l;
  74. }
  75. public void setL(Long l) {
  76. this.l = l;
  77. }
  78. public Float getF() {
  79. return f;
  80. }
  81. public void setF(Float f) {
  82. this.f = f;
  83. }
  84. public Double getD() {
  85. return d;
  86. }
  87. public void setD(Double d) {
  88. this.d = d;
  89. }
  90. public void setId(Long id) {
  91. this.id = id;
  92. }
  93. public Long getId() {
  94. return id;
  95. }
  96. public String getStr() {
  97. return str;
  98. }
  99. public void setStr(String str) {
  100. this.str = str;
  101. }
  102. }