PageRenderTime 37ms CodeModel.GetById 12ms RepoModel.GetById 0ms app.codeStats 0ms

/jboss-as-7.1.1.Final/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jpa/hibernate/envers/Phone.java

#
Java | 99 lines | 54 code | 21 blank | 24 comment | 6 complexity | 736366df4fca3bac80a7e5518551b22c MD5 | raw file
Possible License(s): LGPL-2.1, Apache-2.0
  1. /*
  2. * JBoss, Home of Professional Open Source.
  3. * Copyright 2011, Red Hat, Inc., and individual contributors
  4. * as indicated by the @author tags. See the copyright.txt file in the
  5. * distribution for a full listing of individual contributors.
  6. *
  7. * This is free software; you can redistribute it and/or modify it
  8. * under the terms of the GNU Lesser General Public License as
  9. * published by the Free Software Foundation; either version 2.1 of
  10. * the License, or (at your option) any later version.
  11. *
  12. * This software is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public
  18. * License along with this software; if not, write to the Free
  19. * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  20. * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  21. */
  22. package org.jboss.as.test.integration.jpa.hibernate.envers;
  23. import javax.persistence.Column;
  24. import javax.persistence.Entity;
  25. import javax.persistence.GeneratedValue;
  26. import javax.persistence.Id;
  27. import org.hibernate.envers.Audited;
  28. /**
  29. * @author Madhumita Sadhukhan
  30. */
  31. @Entity
  32. @Audited
  33. public class Phone {
  34. @Id
  35. @GeneratedValue
  36. @Column(name = "PHONE_ID")
  37. private Integer id;
  38. private String type;
  39. private String number;
  40. private String areacode;
  41. public String getNumber() {
  42. return number;
  43. }
  44. public void setNumber(String number) {
  45. this.number = number;
  46. }
  47. public int getId() {
  48. return id;
  49. }
  50. public void setId(int id) {
  51. this.id = id;
  52. }
  53. public String getType() {
  54. return type;
  55. }
  56. public void setType(String type) {
  57. this.type = type;
  58. }
  59. public String getAreacode() {
  60. return areacode;
  61. }
  62. public void setAreacode(String areacode) {
  63. this.areacode = areacode;
  64. }
  65. @Override
  66. public boolean equals(Object o) {
  67. if (this == o)
  68. return true;
  69. if (!(o instanceof Phone))
  70. return false;
  71. final Phone phone = (Phone) o;
  72. return id != null ? id.equals(phone.id) : phone.id == null;
  73. }
  74. @Override
  75. public int hashCode() {
  76. return id != null ? id.hashCode() : 0;
  77. }
  78. }