HHH-5808 - Code formatting

This commit is contained in:
Lukasz Antoniak 2011-05-19 21:39:31 +02:00
parent bcfa5ffed9
commit c4f65ffd8e
3 changed files with 127 additions and 127 deletions

View File

@ -14,63 +14,63 @@ import javax.persistence.IdClass;
@Audited @Audited
@IdClass(AddressPK.class) @IdClass(AddressPK.class)
public class AddressCompositePKEntity { public class AddressCompositePKEntity {
private Integer id; private Integer id;
private Integer ver; private Integer ver;
private String street; private String street;
public AddressCompositePKEntity() { public AddressCompositePKEntity() {
} }
public AddressCompositePKEntity(Integer id, Integer ver, String street) { public AddressCompositePKEntity(Integer id, Integer ver, String street) {
this.setId(id); this.setId(id);
this.setVer(ver); this.setVer(ver);
this.setStreet(street); this.setStreet(street);
} }
@Id @Id
@Column(name = "ID", nullable = false, updatable = false) @Column(name = "ID", nullable = false, updatable = false)
public Integer getId() { public Integer getId() {
return id; return id;
} }
public void setId(Integer id) { public void setId(Integer id) {
this.id = id; this.id = id;
} }
@Id @Id
@Column(name = "VER", nullable = false, updatable = false) @Column(name = "VER", nullable = false, updatable = false)
public Integer getVer() { public Integer getVer() {
return ver; return ver;
} }
public void setVer(Integer ver) { public void setVer(Integer ver) {
this.ver = ver; this.ver = ver;
} }
@Column(name = "STREET", nullable = false) @Column(name = "STREET", nullable = false)
public String getStreet() { public String getStreet() {
return street; return street;
} }
public void setStreet(String street) { public void setStreet(String street) {
this.street = street; this.street = street;
} }
public String toString() { public String toString() {
return "AddressCompositePKEntity[id = " + getId() + ", ver = " + getVer() + ", street = " + getStreet() + "]"; return "AddressCompositePKEntity[id = " + getId() + ", ver = " + getVer() + ", street = " + getStreet() + "]";
} }
@Override @Override
public int hashCode() { public int hashCode() {
int result = 1; int result = 1;
result = 31 * result + ((id == null) ? 0 : id.hashCode()); result = 31 * result + ((id == null) ? 0 : id.hashCode());
result = 31 * result + ((ver == null) ? 0 : ver.hashCode()); result = 31 * result + ((ver == null) ? 0 : ver.hashCode());
result = 31 * result + ((street == null) ? 0 : street.hashCode()); result = 31 * result + ((street == null) ? 0 : street.hashCode());
return result; return result;
} }
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) return true; if (this == o) return true;
if (!(o instanceof AddressCompositePKEntity)) return false; if (!(o instanceof AddressCompositePKEntity)) return false;
@ -81,5 +81,5 @@ public class AddressCompositePKEntity {
if (street != null ? !street.equals(that.street) : that.street != null) return false; if (street != null ? !street.equals(that.street) : that.street != null) return false;
return true; return true;
} }
} }

View File

@ -6,47 +6,47 @@ import java.io.Serializable;
* @author Andrei Zagorneanu * @author Andrei Zagorneanu
*/ */
public class AddressPK implements Serializable { public class AddressPK implements Serializable {
private Integer id; private Integer id;
private Integer ver; private Integer ver;
public AddressPK() { public AddressPK() {
} }
public AddressPK(Integer id, Integer ver) { public AddressPK(Integer id, Integer ver) {
this.setId(id); this.setId(id);
this.setVer(ver); this.setVer(ver);
} }
public Integer getId() { public Integer getId() {
return id; return id;
} }
public void setId(Integer id) { public void setId(Integer id) {
this.id = id; this.id = id;
} }
public Integer getVer() { public Integer getVer() {
return ver; return ver;
} }
public void setVer(Integer ver) { public void setVer(Integer ver) {
this.ver = ver; this.ver = ver;
} }
public String toString() { public String toString() {
return "AddressPK[id = " + getId() + ", ver = " + getVer() + "]"; return "AddressPK[id = " + getId() + ", ver = " + getVer() + "]";
} }
@Override @Override
public int hashCode() { public int hashCode() {
int result = 1; int result = 1;
result = 31 * result + ((id == null) ? 0 : id.hashCode()); result = 31 * result + ((id == null) ? 0 : id.hashCode());
result = 31 * result + ((ver == null) ? 0 : ver.hashCode()); result = 31 * result + ((ver == null) ? 0 : ver.hashCode());
return result; return result;
} }
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) return true; if (this == o) return true;
if (!(o instanceof AddressPK)) return false; if (!(o instanceof AddressPK)) return false;
@ -56,5 +56,5 @@ public class AddressPK implements Serializable {
if (id != null ? !id.equals(that.id) : that.id != null) return false; if (id != null ? !id.equals(that.id) : that.id != null) return false;
return true; return true;
} }
} }

View File

@ -16,64 +16,64 @@ import org.hibernate.envers.Audited;
@Entity @Entity
@Audited @Audited
public class PersonCompositeFKEntity { public class PersonCompositeFKEntity {
private Integer id; private Integer id;
private String name; private String name;
private AddressCompositePKEntity address; private AddressCompositePKEntity address;
public PersonCompositeFKEntity() { public PersonCompositeFKEntity() {
} }
public PersonCompositeFKEntity(Integer id, String name, AddressCompositePKEntity address) { public PersonCompositeFKEntity(Integer id, String name, AddressCompositePKEntity address) {
this.setId(id); this.setId(id);
this.setName(name); this.setName(name);
this.setAddress(address); this.setAddress(address);
} }
@Id @Id
@Column(name = "ID", nullable = false, updatable = false) @Column(name = "ID", nullable = false, updatable = false)
public Integer getId() { public Integer getId() {
return id; return id;
} }
public void setId(Integer id) { public void setId(Integer id) {
this.id = id; this.id = id;
} }
@Column(name = "NAME", nullable = false) @Column(name = "NAME", nullable = false)
public String getName() { public String getName() {
return name; return name;
} }
public void setName(String name) { public void setName(String name) {
this.name = name; this.name = name;
} }
@OneToOne(cascade = { CascadeType.ALL }, orphanRemoval = true) @OneToOne(cascade = {CascadeType.ALL}, orphanRemoval = true)
@JoinColumns({@JoinColumn(name = "ID_ADDRESS", referencedColumnName = "ID"), @JoinColumns({@JoinColumn(name = "ID_ADDRESS", referencedColumnName = "ID"),
@JoinColumn(name = "VER_ADDRESS", referencedColumnName = "VER")}) @JoinColumn(name = "VER_ADDRESS", referencedColumnName = "VER")})
public AddressCompositePKEntity getAddress() { public AddressCompositePKEntity getAddress() {
return address; return address;
} }
public void setAddress(AddressCompositePKEntity address) { public void setAddress(AddressCompositePKEntity address) {
this.address = address; this.address = address;
} }
public String toString() { public String toString() {
return "PersonCompositeFKEntity[id = " + getId() + ", name = " + getName() + "]"; return "PersonCompositeFKEntity[id = " + getId() + ", name = " + getName() + "]";
} }
@Override @Override
public int hashCode() { public int hashCode() {
int result = 1; int result = 1;
result = 31 * result + ((id == null) ? 0 : id.hashCode()); result = 31 * result + ((id == null) ? 0 : id.hashCode());
result = 31 * result + ((name == null) ? 0 : name.hashCode()); result = 31 * result + ((name == null) ? 0 : name.hashCode());
return result; return result;
} }
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) return true; if (this == o) return true;
if (!(o instanceof PersonCompositeFKEntity)) return false; if (!(o instanceof PersonCompositeFKEntity)) return false;
PersonCompositeFKEntity that = (PersonCompositeFKEntity) o; PersonCompositeFKEntity that = (PersonCompositeFKEntity) o;
@ -82,5 +82,5 @@ public class PersonCompositeFKEntity {
if (name != null ? !name.equals(that.name) : that.name != null) return false; if (name != null ? !name.equals(that.name) : that.name != null) return false;
return true; return true;
} }
} }