| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||||||
| AuditField |
|
| 0.0;0 |
| 1 | /* |
|
| 2 | * ============================================================================ |
|
| 3 | * GNU Lesser General Public License |
|
| 4 | * ============================================================================ |
|
| 5 | * |
|
| 6 | * Taylor - The Java Enterprise Application Framework. |
|
| 7 | * Copyright (C) 2005 John Gilbert jgilbert01@users.sourceforge.net |
|
| 8 | * |
|
| 9 | * This library is free software; you can redistribute it and/or |
|
| 10 | * modify it under the terms of the GNU Lesser General Public |
|
| 11 | * License as published by the Free Software Foundation; either |
|
| 12 | * version 2.1 of the License, or (at your option) any later version. |
|
| 13 | * |
|
| 14 | * This library is distributed in the hope that it will be useful, |
|
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
| 17 | * Lesser General Public License for more details. |
|
| 18 | * |
|
| 19 | * You should have received a copy of the GNU Lesser General Public |
|
| 20 | * License along with this library; if not, write to the Free Software |
|
| 21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. |
|
| 22 | * |
|
| 23 | * John Gilbert |
|
| 24 | * Email: jgilbert01@users.sourceforge.net |
|
| 25 | */ |
|
| 26 | package net.taylor.audit.entity; |
|
| 27 | ||
| 28 | ||
| 29 | import java.io.Serializable; |
|
| 30 | ||
| 31 | import javax.persistence.CascadeType; |
|
| 32 | import javax.persistence.Column; |
|
| 33 | import javax.persistence.Entity; |
|
| 34 | import javax.persistence.FetchType; |
|
| 35 | import javax.persistence.GeneratedValue; |
|
| 36 | import javax.persistence.GenerationType; |
|
| 37 | import javax.persistence.Id; |
|
| 38 | import javax.persistence.ManyToOne; |
|
| 39 | ||
| 40 | import net.taylor.audit.BypassAudit; |
|
| 41 | ||
| 42 | import org.apache.commons.lang.builder.ToStringBuilder; |
|
| 43 | import org.apache.commons.lang.builder.ToStringStyle; |
|
| 44 | ||
| 45 | /** |
|
| 46 | * @todo add comment for javadoc |
|
| 47 | * |
|
| 48 | * @author jgilbert |
|
| 49 | * @generated |
|
| 50 | */ |
|
| 51 | @Entity |
|
| 52 | @BypassAudit |
|
| 53 | public class AuditField implements Serializable, Cloneable { |
|
| 54 | /** @generated */ |
|
| 55 | private static final long serialVersionUID = 1L; |
|
| 56 | ||
| 57 | /** @generated */ |
|
| 58 | 213 | public AuditField() { |
| 59 | 213 | } |
| 60 | ||
| 61 | /** |
|
| 62 | * ------------------------------------------------------------------------ |
|
| 63 | * The primary key. |
|
| 64 | * ------------------------------------------------------------------------ |
|
| 65 | * @generated |
|
| 66 | */ |
|
| 67 | @Id |
|
| 68 | @GeneratedValue(strategy = GenerationType.AUTO) |
|
| 69 | public Long getId() { |
|
| 70 | 450 | return id; |
| 71 | } |
|
| 72 | ||
| 73 | /** @generated */ |
|
| 74 | public void setId(final Long id) { |
|
| 75 | 207 | this.id = id; |
| 76 | 207 | } |
| 77 | ||
| 78 | /** @generated */ |
|
| 79 | 213 | private Long id = null; |
| 80 | ||
| 81 | /** |
|
| 82 | * ------------------------------------------------------------------------ |
|
| 83 | * @todo add comment for javadoc |
|
| 84 | * ------------------------------------------------------------------------ |
|
| 85 | * @generated |
|
| 86 | */ |
|
| 87 | ||
| 88 | public String getName() { |
|
| 89 | 753 | return name; |
| 90 | } |
|
| 91 | ||
| 92 | /** @generated */ |
|
| 93 | public void setName(final String name) { |
|
| 94 | 213 | this.name = name; |
| 95 | 213 | } |
| 96 | ||
| 97 | /** @generated */ |
|
| 98 | 213 | private String name = null; |
| 99 | ||
| 100 | /** |
|
| 101 | * ------------------------------------------------------------------------ |
|
| 102 | * @todo add comment for javadoc |
|
| 103 | * ------------------------------------------------------------------------ |
|
| 104 | * @generated |
|
| 105 | */ |
|
| 106 | ||
| 107 | @Column(length = 4000, unique = false, precision = 0, scale = 0, nullable = true, insertable = true, updatable = true) |
|
| 108 | public String getOldValue() { |
|
| 109 | 738 | return oldValue; |
| 110 | } |
|
| 111 | ||
| 112 | /** @generated */ |
|
| 113 | public void setOldValue(final String oldValue) { |
|
| 114 | 207 | this.oldValue = oldValue; |
| 115 | 207 | } |
| 116 | ||
| 117 | /** @generated */ |
|
| 118 | 213 | private String oldValue = null; |
| 119 | ||
| 120 | /** |
|
| 121 | * ------------------------------------------------------------------------ |
|
| 122 | * @todo add comment for javadoc |
|
| 123 | * ------------------------------------------------------------------------ |
|
| 124 | * @generated |
|
| 125 | */ |
|
| 126 | ||
| 127 | @Column(length = 4000, unique = false, precision = 0, scale = 0, nullable = true, insertable = true, updatable = true) |
|
| 128 | public String getNewValue() { |
|
| 129 | 738 | return newValue; |
| 130 | } |
|
| 131 | ||
| 132 | /** @generated */ |
|
| 133 | public void setNewValue(final String newValue) { |
|
| 134 | 207 | this.newValue = newValue; |
| 135 | 207 | } |
| 136 | ||
| 137 | /** @generated */ |
|
| 138 | 213 | private String newValue = null; |
| 139 | ||
| 140 | /** |
|
| 141 | * ------------------------------------------------------------------------ |
|
| 142 | * @todo add comment for javadoc |
|
| 143 | * ------------------------------------------------------------------------ |
|
| 144 | * @generated |
|
| 145 | */ |
|
| 146 | @ManyToOne(optional = true, fetch = FetchType.EAGER, cascade = CascadeType.MERGE) |
|
| 147 | public AuditEntry getEntry() { |
|
| 148 | 732 | return entry; |
| 149 | } |
|
| 150 | ||
| 151 | /** @generated */ |
|
| 152 | public void setEntry(final AuditEntry entry) { |
|
| 153 | 207 | this.entry = entry; |
| 154 | 207 | } |
| 155 | ||
| 156 | /** @generated */ |
|
| 157 | 213 | private AuditEntry entry = null; |
| 158 | ||
| 159 | // ------------------------------------------------------------------------ |
|
| 160 | // Utils |
|
| 161 | // ------------------------------------------------------------------------ |
|
| 162 | ||
| 163 | ||
| 164 | /** @generated */ |
|
| 165 | public String toString() { |
|
| 166 | 579 | return ToStringBuilder.reflectionToString(this,ToStringStyle.MULTI_LINE_STYLE); |
| 167 | } |
|
| 168 | ||
| 169 | /** @generated */ |
|
| 170 | public AuditField deepClone() throws Exception { |
|
| 171 | 0 | AuditField clone = (AuditField) super.clone(); |
| 172 | 0 | clone.setId(null); |
| 173 | 0 | return clone; |
| 174 | } |
|
| 175 | ||
| 176 | /** @generated */ |
|
| 177 | @Override |
|
| 178 | public int hashCode() { |
|
| 179 | 1887 | final int PRIME = 31; |
| 180 | 1887 | int result = 1; |
| 181 | 1887 | result = PRIME * result + ((id == null) ? super.hashCode() : id.hashCode()); |
| 182 | 1887 | return result; |
| 183 | } |
|
| 184 | ||
| 185 | /** @generated */ |
|
| 186 | @Override |
|
| 187 | public boolean equals(Object obj) { |
|
| 188 | 95 | if (this == obj) |
| 189 | 6 | return true; |
| 190 | 89 | if (obj == null) |
| 191 | 6 | return false; |
| 192 | 83 | if (!(obj instanceof AuditField)) |
| 193 | 83 | return false; |
| 194 | 0 | final AuditField other = (AuditField) obj; |
| 195 | 0 | if (id == null) { |
| 196 | 0 | if (other.getId() != null) |
| 197 | 0 | return false; |
| 198 | 0 | } else if (!id.equals(other.getId())) |
| 199 | 0 | return false; |
| 200 | 0 | return true; |
| 201 | } |
|
| 202 | } |