feat: 添加日志配置和Logback依赖

refactor: 重构实体类equals和hashCode方法

fix: 修复WebSocketService消息发送逻辑

style: 格式化代码和优化导入

docs: 更新JacksonConfig日期序列化格式

test: 添加CompanyFilePathTableCell测试类

chore: 清理无用代码和注释
This commit is contained in:
2025-09-11 19:44:28 +08:00
parent 375de610ef
commit a1b87de7c0
149 changed files with 2246 additions and 1413 deletions

View File

@@ -3,7 +3,7 @@ package com.ecep.contract.model;
import java.io.Serializable;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -40,15 +40,7 @@ public class Bank implements BasedEntity, IdentityEntity, Serializable {
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null)
return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy
? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass()
: object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass()
: this.getClass();
if (thisEffectiveClass != oEffectiveClass)
if (object == null || HibernateProxyUtils.isNotEffectiveClassEquals(this, object))
return false;
Bank bank = (Bank) object;
return getId() != null && Objects.equals(getId(), bank.getId());
@@ -56,8 +48,6 @@ public class Bank implements BasedEntity, IdentityEntity, Serializable {
@Override
public final int hashCode() {
return this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode()
: getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -15,7 +15,7 @@ import lombok.ToString;
@Setter
@MappedSuperclass
@ToString
public class BaseEnumEntity<T extends Enum<?>> implements IdentityEntity {
public abstract class BaseEnumEntity<T extends Enum<?>> implements IdentityEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "ID", nullable = false)
@@ -33,4 +33,5 @@ public class BaseEnumEntity<T extends Enum<?>> implements IdentityEntity {
@Column(name = "VALUE")
private String value;
}

View File

@@ -1,11 +1,13 @@
package com.ecep.contract.model;
import java.io.Serializable;
import java.time.Instant;
import java.time.LocalDateTime;
import java.util.Objects;
import org.hibernate.annotations.ColumnDefault;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.FetchType;
@@ -133,4 +135,22 @@ public class CloudRk implements IdentityEntity, Serializable {
*/
@Column(name = "VERSION", nullable = false)
private Integer version = 0;
@Override
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
CloudRk cloudRk = (CloudRk) object;
return getId() != null && Objects.equals(getId(), cloudRk.getId());
}
@Override
public final int hashCode() {
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -5,7 +5,8 @@ import java.time.Instant;
import java.util.Objects;
import org.hibernate.annotations.ColumnDefault;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -71,28 +72,21 @@ public class CloudTyc implements IdentityEntity, Serializable {
private int version;
@Override
public final boolean equals(Object o) {
if (this == o)
public final boolean equals(Object object) {
if (this == object)
return true;
if (o == null)
if (object == null)
return false;
Class<?> oEffectiveClass = o instanceof HibernateProxy
? ((HibernateProxy) o).getHibernateLazyInitializer().getPersistentClass()
: o.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass()
: this.getClass();
if (thisEffectiveClass != oEffectiveClass)
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
CloudTyc cloudInfo = (CloudTyc) o;
}
CloudTyc cloudInfo = (CloudTyc) object;
return getId() != null && Objects.equals(getId(), cloudInfo.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode()
: getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -3,9 +3,12 @@ package com.ecep.contract.model;
import java.io.Serializable;
import java.time.Instant;
import java.time.LocalDate;
import java.util.Objects;
import org.hibernate.annotations.ColumnDefault;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.FetchType;
@@ -69,4 +72,22 @@ public class CloudYu implements IdentityEntity, Serializable {
*/
@Column(name = "CLOUD_LATEST")
private Instant cloudLatest;
@Override
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
CloudYu cloudYu = (CloudYu) object;
return getId() != null && Objects.equals(getId(), cloudYu.getId());
}
@Override
public final int hashCode() {
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -5,7 +5,8 @@ import java.time.LocalDate;
import java.util.Objects;
import org.hibernate.annotations.ColumnDefault;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -185,15 +186,7 @@ public class Company implements IdentityEntity, NamedEntity, BasedEntity, Serial
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null)
return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy
? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass()
: object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass()
: this.getClass();
if (thisEffectiveClass != oEffectiveClass)
if (object == null || HibernateProxyUtils.isNotEffectiveClassEquals(this, object))
return false;
Company company = (Company) object;
return getId() != null && Objects.equals(getId(), company.getId());
@@ -201,9 +194,7 @@ public class Company implements IdentityEntity, NamedEntity, BasedEntity, Serial
@Override
public final int hashCode() {
return this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode()
: getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -1,6 +1,10 @@
package com.ecep.contract.model;
import java.io.Serializable;
import java.util.Objects;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.FetchType;
import jakarta.persistence.GeneratedValue;
@@ -17,7 +21,7 @@ import lombok.ToString;
@Setter
@jakarta.persistence.Entity
@Table(name = "COMPANY_BANK_ACCOUNT", schema = "supplier_ms")
public class CompanyBankAccount implements IdentityEntity, BasedEntity, CompanyBasedEntity, Serializable {
public class CompanyBankAccount implements IdentityEntity, BasedEntity, CompanyBasedEntity, Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -49,9 +53,23 @@ public class CompanyBankAccount implements IdentityEntity, BasedEntity, Company
@Column(name = "DESCRIPTION")
private String description;
@Override
public String toPrettyString() {
return account;
}
@Override
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null || HibernateProxyUtils.isNotEffectiveClassEquals(this, object))
return false;
CompanyBankAccount that = (CompanyBankAccount) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -2,11 +2,13 @@ package com.ecep.contract.model;
import java.io.Serializable;
import java.time.LocalDate;
import java.util.Objects;
import org.hibernate.annotations.OnDelete;
import org.hibernate.annotations.OnDeleteAction;
import com.ecep.contract.BlackReasonType;
import com.ecep.contract.util.HibernateProxyUtils;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import jakarta.persistence.Column;
@@ -31,7 +33,7 @@ import lombok.Setter;
})
// @org.springframework.data.relational.core.mapping.Table("COMPANY_BLACK_REASON")
@JsonIgnoreProperties(ignoreUnknown = true)
public class CompanyBlackReason implements IdentityEntity, CompanyBasedEntity, Serializable {
public class CompanyBlackReason implements IdentityEntity, CompanyBasedEntity, Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -71,4 +73,21 @@ public class CompanyBlackReason implements IdentityEntity, CompanyBasedEntity,
@Column(name = "`KEY`")
private String key;
@Override
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
CompanyBlackReason that = (CompanyBlackReason) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -5,7 +5,8 @@ import java.time.LocalDate;
import java.util.Objects;
import org.hibernate.annotations.ColumnDefault;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -85,15 +86,7 @@ public class CompanyContact implements IdentityEntity, NamedEntity, BasedEntity,
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null)
return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy
? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass()
: object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass()
: this.getClass();
if (thisEffectiveClass != oEffectiveClass)
if (object == null || HibernateProxyUtils.isNotEffectiveClassEquals(this, object))
return false;
CompanyContact that = (CompanyContact) object;
return getId() != null && Objects.equals(getId(), that.getId());
@@ -101,9 +94,7 @@ public class CompanyContact implements IdentityEntity, NamedEntity, BasedEntity,
@Override
public final int hashCode() {
return this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode()
: getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -2,6 +2,9 @@ package com.ecep.contract.model;
import java.io.Serializable;
import java.util.Map;
import java.util.Objects;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -27,7 +30,7 @@ import lombok.ToString;
}, uniqueConstraints = {
})
@ToString(exclude = {"company", "contract"})
@ToString(exclude = { "company", "contract" })
public class CompanyContract implements IdentityEntity, CompanyBasedEntity, Serializable {
private static final long serialVersionUID = 1L;
@Id
@@ -54,4 +57,22 @@ public class CompanyContract implements IdentityEntity, CompanyBasedEntity, Seri
contact.getPhone() +
contact.getEmail();
}
@Override
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
CompanyContract that = (CompanyContract) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -6,7 +6,8 @@ import java.time.LocalDate;
import java.util.Objects;
import org.hibernate.annotations.ColumnDefault;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -79,15 +80,7 @@ public class CompanyCustomer implements IdentityEntity, CompanyBasedEntity, Seri
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null)
return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy
? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass()
: object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass()
: this.getClass();
if (thisEffectiveClass != oEffectiveClass)
if (object == null || HibernateProxyUtils.isNotEffectiveClassEquals(this, object))
return false;
CompanyCustomer that = (CompanyCustomer) object;
return getId() != null && Objects.equals(getId(), that.getId());
@@ -95,8 +88,6 @@ public class CompanyCustomer implements IdentityEntity, CompanyBasedEntity, Seri
@Override
public final int hashCode() {
return this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode()
: getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -5,7 +5,7 @@ import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -102,22 +102,15 @@ public class CompanyCustomerEntity implements IdentityEntity, Serializable {
return true;
if (object == null)
return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy
? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass()
: object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass()
: this.getClass();
if (thisEffectiveClass != oEffectiveClass)
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
CompanyCustomerEntity that = (CompanyCustomerEntity) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode()
: getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -1,6 +1,10 @@
package com.ecep.contract.model;
import java.io.Serializable;
import java.util.Objects;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.CascadeType;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -62,9 +66,23 @@ public class CompanyCustomerEvaluationFormFile implements IdentityEntity, BasedE
@Column(name = "SCORE_TEMPLATE_VER")
private Integer scoreTemplateVersion = 1;
@Override
public String toPrettyString() {
return getCatalog() + ", level=" + getCreditLevel();
}
@Override
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null || HibernateProxyUtils.isNotEffectiveClassEquals(this, object))
return false;
CompanyCustomerEvaluationFormFile that = (CompanyCustomerEvaluationFormFile) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -2,8 +2,10 @@ package com.ecep.contract.model;
import java.io.Serializable;
import java.time.LocalDate;
import java.util.Objects;
import com.ecep.contract.CompanyCustomerFileType;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -61,4 +63,19 @@ public class CompanyCustomerFile implements CompanyBasicFile<CompanyCustomerFile
@Column(name = "VALID")
private boolean valid = false;
@Override
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null || HibernateProxyUtils.isNotEffectiveClassEquals(this, object))
return false;
CompanyCustomerFile that = (CompanyCustomerFile) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -1,8 +1,10 @@
package com.ecep.contract.model;
import java.io.Serializable;
import java.util.Objects;
import com.ecep.contract.CompanyCustomerFileType;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
@@ -18,4 +20,21 @@ import lombok.ToString;
public class CompanyCustomerFileTypeLocal extends BaseEnumEntity<CompanyCustomerFileType> implements Serializable {
private static final long serialVersionUID = 1L;
@Override
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
CompanyCustomerFileTypeLocal that = (CompanyCustomerFileTypeLocal) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -4,7 +4,8 @@ import java.io.Serializable;
import java.util.Objects;
import org.hibernate.annotations.ColumnDefault;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -49,20 +50,18 @@ public class CompanyExtendInfo implements IdentityEntity, Serializable {
@ToString.Exclude
private int version;
@Override
public final boolean equals(Object object) {
if (this == object) return true;
if (object == null) return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy ? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass() : object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
if (this == object)
return true;
if (object == null || HibernateProxyUtils.isNotEffectiveClassEquals(this, object))
return false;
CompanyExtendInfo that = (CompanyExtendInfo) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -2,8 +2,10 @@ package com.ecep.contract.model;
import java.io.Serializable;
import java.time.LocalDate;
import java.util.Objects;
import com.ecep.contract.CompanyFileType;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -28,7 +30,7 @@ import lombok.ToString;
@Entity
@Table(name = "COMPANY_FILE")
@ToString
public class CompanyFile implements IdentityEntity, CompanyBasedEntity, Serializable {
public class CompanyFile implements IdentityEntity, CompanyBasedEntity, Serializable {
private static final long serialVersionUID = 1L;
@Id
@@ -61,4 +63,22 @@ public class CompanyFile implements IdentityEntity, CompanyBasedEntity, Seriali
*/
@Column(name = "FILE_PATH")
private String filePath;
@Override
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
CompanyFile that = (CompanyFile) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -1,8 +1,10 @@
package com.ecep.contract.model;
import java.io.Serializable;
import java.util.Objects;
import com.ecep.contract.CompanyFileType;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
@@ -17,4 +19,22 @@ import lombok.ToString;
@ToString
public class CompanyFileTypeLocal extends BaseEnumEntity<CompanyFileType> implements Serializable {
private static final long serialVersionUID = 1L;
@Override
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
CompanyFileTypeLocal that = (CompanyFileTypeLocal) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -3,7 +3,7 @@ package com.ecep.contract.model;
import java.io.Serializable;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -43,19 +43,19 @@ public class CompanyInvoiceInfo implements IdentityEntity, NamedEntity, BasedEnt
private Company company;
@Column(name = "TAX")
private String taxId; // 税号(纳税人识别号)
private String taxId; // 税号(纳税人识别号)
@Column(name = "ADDR")
private String address; // 地址
private String address; // 地址
@Column(name = "TEL")
private String phone; // 电话
private String phone; // 电话
@Column(name = "BANK")
private String bankName; // 开户行
private String bankName; // 开户行
@Column(name = "BANK_ACCOUNT")
private String bankAccount; // 银行账号
private String bankAccount; // 银行账号
@Override
public String toPrettyString() {
@@ -63,18 +63,20 @@ public class CompanyInvoiceInfo implements IdentityEntity, NamedEntity, BasedEnt
}
@Override
public final boolean equals(Object o) {
if (this == o) return true;
if (o == null) return false;
Class<?> oEffectiveClass = o instanceof HibernateProxy ? ((HibernateProxy) o).getHibernateLazyInitializer().getPersistentClass() : o.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
CompanyInvoiceInfo that = (CompanyInvoiceInfo) o;
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
CompanyInvoiceInfo that = (CompanyInvoiceInfo) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -5,7 +5,8 @@ import java.time.LocalDate;
import java.util.Objects;
import org.hibernate.annotations.ColumnDefault;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -62,18 +63,20 @@ public class CompanyOldName implements IdentityEntity, NamedEntity, Serializable
private int version;
@Override
public final boolean equals(Object o) {
if (this == o) return true;
if (o == null) return false;
Class<?> oEffectiveClass = o instanceof HibernateProxy ? ((HibernateProxy) o).getHibernateLazyInitializer().getPersistentClass() : o.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
CompanyOldName that = (CompanyOldName) o;
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
CompanyOldName that = (CompanyOldName) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -7,9 +7,9 @@ import java.util.List;
import java.util.Objects;
import org.hibernate.annotations.ColumnDefault;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.VendorType;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -46,7 +46,6 @@ public class CompanyVendor implements IdentityEntity, CompanyBasedEntity, Serial
@Column(name = "TYPE")
private VendorType type;
@ColumnDefault("false")
@Column(name = "PROTOCOL_PROVIDER", nullable = false)
private boolean protocolProvider = false;
@@ -107,17 +106,19 @@ public class CompanyVendor implements IdentityEntity, CompanyBasedEntity, Serial
@Override
public final boolean equals(Object object) {
if (this == object) return true;
if (object == null) return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy ? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass() : object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
CompanyVendor that = (CompanyVendor) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -2,6 +2,9 @@ package com.ecep.contract.model;
import java.io.Serializable;
import java.time.LocalDate;
import java.util.Objects;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -31,13 +34,11 @@ public class CompanyVendorApprovedFile implements IdentityEntity, Serializable {
@Column(name = "ID", nullable = false)
private Integer id;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "LIST_ID", nullable = false)
@ToString.Exclude
private CompanyVendorApprovedList list;
/**
* 文件名,不含目录,目录使用目录的目录
*/
@@ -56,4 +57,21 @@ public class CompanyVendorApprovedFile implements IdentityEntity, Serializable {
@Column(name = "DESCRIPTION")
private String description;
@Override
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
CompanyVendorApprovedFile that = (CompanyVendorApprovedFile) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -3,9 +3,8 @@ package com.ecep.contract.model;
import java.io.Serializable;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.VendorType;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -66,17 +65,19 @@ public class CompanyVendorApprovedItem implements IdentityEntity, Serializable {
@Override
public final boolean equals(Object object) {
if (this == object) return true;
if (object == null) return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy ? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass() : object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
CompanyVendorApprovedItem that = (CompanyVendorApprovedItem) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -4,7 +4,7 @@ import java.io.Serializable;
import java.time.LocalDate;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -16,7 +16,6 @@ import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
/**
* 合格供应商名录
* 每年一条记录
@@ -60,17 +59,19 @@ public class CompanyVendorApprovedList implements IdentityEntity, Serializable {
@Override
public final boolean equals(Object object) {
if (this == object) return true;
if (object == null) return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy ? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass() : object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
CompanyVendorApprovedList that = (CompanyVendorApprovedList) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -5,7 +5,7 @@ import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -20,7 +20,6 @@ import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
/**
* 供应商的关联详细项关联信息用于绑定U8系统中的供应商编号
*/
@@ -96,20 +95,18 @@ public class CompanyVendorEntity implements IdentityEntity, Serializable {
@Column(name = "FETCHED_TIME")
private LocalDateTime fetchedTime;
@Override
public final boolean equals(Object object) {
if (this == object) return true;
if (object == null) return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy ? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass() : object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
if (this == object)
return true;
if (object == null || HibernateProxyUtils.isNotEffectiveClassEquals(this, object))
return false;
CompanyVendorEntity that = (CompanyVendorEntity) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -2,8 +2,10 @@ package com.ecep.contract.model;
import java.io.Serializable;
import java.time.LocalDate;
import java.util.Objects;
import com.ecep.contract.CompanyVendorFileType;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -64,4 +66,22 @@ public class CompanyVendorFile implements CompanyBasicFile<CompanyVendorFileType
@Column(name = "VALID")
private boolean valid = false;
@Override
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
CompanyVendorFile that = (CompanyVendorFile) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -1,6 +1,9 @@
package com.ecep.contract.model;
import java.util.Objects;
import com.ecep.contract.CompanyVendorFileType;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
@@ -17,5 +20,21 @@ import lombok.ToString;
@Table(name = "COMPANY_VENDOR_FILE_TYPE_LOCAL")
@ToString
public class CompanyVendorFileTypeLocal extends BaseEnumEntity<CompanyVendorFileType> {
@Override
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
CompanyVendorFileTypeLocal that = (CompanyVendorFileTypeLocal) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -6,9 +6,9 @@ import java.time.LocalDateTime;
import java.util.Objects;
import org.hibernate.annotations.ColumnDefault;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.ContractPayWay;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -70,12 +70,27 @@ public class Contract implements IdentityEntity, NamedEntity, BasedEntity, Compa
/**
* 合同状态U8 系统中的合同状态,目前含义未知
* <table>
* <caption>各个状态值的统计情况如下数据样本日期2025-02-08</caption>
* <tr><th>State</th><th>Count</th></tr>
* <tr><td>null</td><td>3891</td></tr>
* <tr><td>A</td><td>9</td></tr>
* <tr><td>B</td><td>6499</td></tr>
* <tr><td>C</td><td>79</td></tr>
* <caption>各个状态值的统计情况如下数据样本日期2025-02-08</caption>
* <tr>
* <th>State</th>
* <th>Count</th>
* </tr>
* <tr>
* <td>null</td>
* <td>3891</td>
* </tr>
* <tr>
* <td>A</td>
* <td>9</td>
* </tr>
* <tr>
* <td>B</td>
* <td>6499</td>
* </tr>
* <tr>
* <td>C</td>
* <td>79</td>
* </tr>
* </table>
*/
@Column(name = "STATE")
@@ -83,21 +98,21 @@ public class Contract implements IdentityEntity, NamedEntity, BasedEntity, Compa
/**
* 合同分组
*/
// @ManyToOne(fetch = FetchType.EAGER)
// @ManyToOne(fetch = FetchType.EAGER)
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "GROUP_ID")
private ContractGroup group;
/**
* 分类
*/
// @ManyToOne(fetch = FetchType.EAGER)
// @ManyToOne(fetch = FetchType.EAGER)
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "TYPE_ID")
private ContractType type;
/**
* 性质
*/
// @ManyToOne(fetch = FetchType.EAGER)
// @ManyToOne(fetch = FetchType.EAGER)
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "KIND_ID")
private ContractKind kind;
@@ -267,7 +282,6 @@ public class Contract implements IdentityEntity, NamedEntity, BasedEntity, Compa
@Column(name = "EXEC_UNTAX_AMOUNT")
private double execUnTaxAmount;
@Override
public String toPrettyString() {
return getCode() + " " + getName();
@@ -275,17 +289,19 @@ public class Contract implements IdentityEntity, NamedEntity, BasedEntity, Compa
@Override
public final boolean equals(Object object) {
if (this == object) return true;
if (object == null) return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy ? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass() : object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
Contract contract = (Contract) object;
return getId() != null && Objects.equals(getId(), contract.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -1,7 +1,9 @@
package com.ecep.contract.model;
import java.io.Serializable;
import org.hibernate.proxy.HibernateProxy;
import java.util.Objects;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -57,22 +59,15 @@ public class ContractBidVendor implements IdentityEntity, ContractBasedEntity, S
return true;
if (object == null)
return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy
? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass()
: object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass()
: this.getClass();
if (thisEffectiveClass != oEffectiveClass)
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
ContractBidVendor that = (ContractBidVendor) object;
return equals(that);
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode()
: getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -3,7 +3,7 @@ package com.ecep.contract.model;
import java.io.Serializable;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -53,17 +53,19 @@ public class ContractCatalog implements IdentityEntity, NamedEntity, Serializabl
@Override
public final boolean equals(Object object) {
if (this == object) return true;
if (object == null) return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy ? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass() : object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
ContractCatalog that = (ContractCatalog) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -4,9 +4,8 @@ import java.io.Serializable;
import java.time.LocalDate;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.ContractFileType;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -68,17 +67,19 @@ public class ContractFile implements IdentityEntity, ContractBasedEntity, Serial
@Override
public final boolean equals(Object object) {
if (this == object) return true;
if (object == null) return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy ? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass() : object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
ContractFile that = (ContractFile) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -1,6 +1,9 @@
package com.ecep.contract.model;
import java.util.Objects;
import com.ecep.contract.ContractFileType;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -24,4 +27,21 @@ public class ContractFileTypeLocal extends BaseEnumEntity<ContractFileType> {
@Column(name = "SUGGEST_FILE_NAME")
private String suggestFileName;
@Override
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
ContractFileTypeLocal that = (ContractFileTypeLocal) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -3,7 +3,7 @@ package com.ecep.contract.model;
import java.io.Serializable;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -51,17 +51,19 @@ public class ContractGroup implements IdentityEntity, NamedEntity, Serializable
@Override
public final boolean equals(Object object) {
if (this == object) return true;
if (object == null) return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy ? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass() : object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
ContractGroup that = (ContractGroup) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -5,7 +5,7 @@ import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -76,7 +76,6 @@ public class ContractItem implements IdentityEntity, ContractBasedEntity, BasedE
@ToString.Exclude
private Inventory inventory;
/**
* 不含税单价
*/
@@ -148,17 +147,19 @@ public class ContractItem implements IdentityEntity, ContractBasedEntity, BasedE
@Override
public final boolean equals(Object object) {
if (this == object) return true;
if (object == null) return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy ? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass() : object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
ContractItem that = (ContractItem) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -3,7 +3,7 @@ package com.ecep.contract.model;
import java.io.Serializable;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -39,7 +39,6 @@ public class ContractKind implements IdentityEntity, NamedEntity, Serializable {
@Column(name = "NAME")
private String name;
@Column(name = "TITLE")
private String title;
@@ -53,17 +52,19 @@ public class ContractKind implements IdentityEntity, NamedEntity, Serializable {
@Override
public final boolean equals(Object object) {
if (this == object) return true;
if (object == null) return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy ? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass() : object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
ContractKind that = (ContractKind) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -3,6 +3,9 @@ package com.ecep.contract.model;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Objects;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -41,7 +44,6 @@ public class ContractPayPlan implements IdentityEntity, ContractBasedEntity, Ser
@Column(name = "REF_ID")
private Integer refId;
@Column(name = "PAY_DATE")
private LocalDate payDate;
@@ -66,4 +68,22 @@ public class ContractPayPlan implements IdentityEntity, ContractBasedEntity, Ser
*/
@Column(name = "UPDATE_TIME")
private LocalDateTime updateDate;
@Override
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
ContractPayPlan that = (ContractPayPlan) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -3,7 +3,7 @@ package com.ecep.contract.model;
import java.io.Serializable;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -59,17 +59,19 @@ public class ContractType implements IdentityEntity, NamedEntity, Serializable {
@Override
public final boolean equals(Object object) {
if (this == object) return true;
if (object == null) return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy ? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass() : object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
ContractType that = (ContractType) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -1,12 +1,18 @@
package com.ecep.contract.model;
import jakarta.persistence.*;
import java.util.Objects;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.proxy.HibernateProxy;
import java.util.Objects;
/**
* U8系统的 客户分类
@@ -45,22 +51,15 @@ public class CustomerCatalog implements BasedEntity {
return true;
if (object == null)
return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy
? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass()
: object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass()
: this.getClass();
if (thisEffectiveClass != oEffectiveClass)
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
CustomerCatalog that = (CustomerCatalog) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode()
: getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -2,6 +2,9 @@ package com.ecep.contract.model;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Objects;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -76,4 +79,22 @@ public class CustomerSatisfactionSurvey implements IdentityEntity, ProjectBasedE
*/
@Column(name = "DESCRIPTION")
private String description;
@Override
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
CustomerSatisfactionSurvey that = (CustomerSatisfactionSurvey) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -2,7 +2,7 @@ package com.ecep.contract.model;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -51,17 +51,19 @@ public class DeliverySignMethod implements BasedEntity, IdentityEntity {
@Override
public final boolean equals(Object object) {
if (this == object) return true;
if (object == null) return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy ? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass() : object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
DeliverySignMethod that = (DeliverySignMethod) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -3,7 +3,7 @@ package com.ecep.contract.model;
import java.io.Serializable;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.FetchType;
@@ -31,7 +31,6 @@ public class Department implements BasedEntity, IdentityEntity, Serializable {
@Column(name = "CODE")
private String code;
@Column(name = "NAME")
private String name;
@@ -50,17 +49,16 @@ public class Department implements BasedEntity, IdentityEntity, Serializable {
@Override
public final boolean equals(Object object) {
if (this == object) return true;
if (object == null) return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy ? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass() : object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
if (this == object)
return true;
if (object == null || HibernateProxyUtils.isNotEffectiveClassEquals(this, object))
return false;
Department that = (Department) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -4,8 +4,7 @@ import java.io.Serializable;
import java.time.LocalDate;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
@@ -118,15 +117,7 @@ public class Employee implements BasedEntity, IdentityEntity, NamedEntity, Seria
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null)
return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy
? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass()
: object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass()
: this.getClass();
if (thisEffectiveClass != oEffectiveClass)
if (object == null || HibernateProxyUtils.isNotEffectiveClassEquals(this, object))
return false;
Employee employee = (Employee) object;
return getId() != null && Objects.equals(getId(), employee.getId());
@@ -134,8 +125,6 @@ public class Employee implements BasedEntity, IdentityEntity, NamedEntity, Seria
@Override
public final int hashCode() {
return this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode()
: getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -1,14 +1,22 @@
package com.ecep.contract.model;
import java.io.Serializable;
import jakarta.persistence.*;
import java.time.LocalDateTime;
import java.util.Objects;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.FetchType;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.Table;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.proxy.HibernateProxy;
import java.time.LocalDateTime;
import java.util.Objects;
@Getter
@Setter
@@ -50,7 +58,6 @@ public class EmployeeAuthBind implements BasedEntity, IdentityEntity, Serializab
@Column(name = "DESCRIPTION")
private String description;
@Override
public String toPrettyString() {
return ip + " " + mac;
@@ -58,17 +65,19 @@ public class EmployeeAuthBind implements BasedEntity, IdentityEntity, Serializab
@Override
public final boolean equals(Object object) {
if (this == object) return true;
if (object == null) return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy ? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass() : object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
EmployeeAuthBind bank = (EmployeeAuthBind) object;
return getId() != null && Objects.equals(getId(), bank.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -1,19 +1,27 @@
package com.ecep.contract.model;
import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.proxy.HibernateProxy;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Objects;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.FetchType;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.Table;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@jakarta.persistence.Entity
@Table(name = "EMPLOYEE_LOGIN_HISTORY", schema = "supplier_ms")
public class EmployeeLoginHistory implements BasedEntity ,IdentityEntity, Serializable {
public class EmployeeLoginHistory implements BasedEntity, IdentityEntity, Serializable {
private static final long serialVersionUID = 1L;
@Id
@@ -37,7 +45,6 @@ public class EmployeeLoginHistory implements BasedEntity ,IdentityEntity, Serial
@Column(name = "LATEST_ACTIVE")
private LocalDateTime activeTime;
@Override
public String toPrettyString() {
return ip + " " + mac;
@@ -45,17 +52,19 @@ public class EmployeeLoginHistory implements BasedEntity ,IdentityEntity, Serial
@Override
public final boolean equals(Object object) {
if (this == object) return true;
if (object == null) return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy ? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass() : object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
EmployeeLoginHistory bank = (EmployeeLoginHistory) object;
return getId() != null && Objects.equals(getId(), bank.getId());
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
EmployeeLoginHistory that = (EmployeeLoginHistory) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -1,56 +1,85 @@
package com.ecep.contract.model;
import jakarta.persistence.*;
import java.io.Serializable;
import java.util.Objects;
import com.ecep.contract.util.HibernateProxyUtils;
import com.fasterxml.jackson.annotation.JsonIgnore;
import jakarta.persistence.CascadeType;
import jakarta.persistence.Column;
import jakarta.persistence.FetchType;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.JoinTable;
import jakarta.persistence.ManyToMany;
import jakarta.persistence.Table;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonIgnore;
@Getter
@Setter
@jakarta.persistence.Entity
@Table(name = "EMPLOYEE_ROLE", schema = "supplier_ms")
public class EmployeeRole implements IdentityEntity, NamedEntity, Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "ID", nullable = false)
private Integer id;
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "ID", nullable = false)
private Integer id;
@Column(name = "CODE")
private String code;
@Column(name = "CODE")
private String code;
@Column(name = "NAME")
private String name;
@Column(name = "NAME")
private String name;
/**
* 是否系统管理员
*/
@Column(name = "SYS_ADMIN")
private boolean systemAdministrator;
/**
* 是否系统管理员
*/
@Column(name = "SYS_ADMIN")
private boolean systemAdministrator;
/**
* 是否管理层
*/
@Column(name = "MANAGER")
private boolean manager;
/**
* 是否管理层
*/
@Column(name = "MANAGER")
private boolean manager;
/**
* 是否启用
*/
@Column(name = "IS_ACTIVE")
private boolean active = true;
/**
* 是否启用
*/
@Column(name = "IS_ACTIVE")
private boolean active = true;
@ManyToMany(fetch = FetchType.LAZY, cascade = { CascadeType.PERSIST, CascadeType.MERGE })
@JoinTable(name = "EMPLOYEE_ROLE_FUNCTIONS", joinColumns = @JoinColumn(name = "ROLE_ID"), inverseJoinColumns = @JoinColumn(name = "FUNC_ID"))
@JsonIgnore
private java.util.List<Function> functions = new java.util.ArrayList<>();
@ManyToMany(fetch = FetchType.LAZY, cascade = { CascadeType.PERSIST, CascadeType.MERGE })
@JoinTable(name = "EMPLOYEE_ROLE_FUNCTIONS", joinColumns = @JoinColumn(name = "ROLE_ID"), inverseJoinColumns = @JoinColumn(name = "FUNC_ID"))
@JsonIgnore
private java.util.List<Function> functions = new java.util.ArrayList<>();
@ManyToMany(fetch = FetchType.LAZY, cascade = { CascadeType.PERSIST, CascadeType.MERGE })
@JoinTable(name = "EMPLOYEE_ROLES", joinColumns = @JoinColumn(name = "ROLE_ID"), inverseJoinColumns = @JoinColumn(name = "EMPLOYEE_ID"))
@JsonIgnore
private java.util.List<Employee> employees = new java.util.ArrayList<>();
@ManyToMany(fetch = FetchType.LAZY, cascade = { CascadeType.PERSIST, CascadeType.MERGE })
@JoinTable(name = "EMPLOYEE_ROLES", joinColumns = @JoinColumn(name = "ROLE_ID"), inverseJoinColumns = @JoinColumn(name = "EMPLOYEE_ID"))
@JsonIgnore
private java.util.List<Employee> employees = new java.util.ArrayList<>();
@Override
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
EmployeeRole that = (EmployeeRole) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -2,7 +2,7 @@ package com.ecep.contract.model;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -62,22 +62,15 @@ public class ExtendVendorInfo implements IdentityEntity {
return true;
if (object == null)
return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy
? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass()
: object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass()
: this.getClass();
if (thisEffectiveClass != oEffectiveClass)
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
ExtendVendorInfo that = (ExtendVendorInfo) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode()
: getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -1,11 +1,18 @@
package com.ecep.contract.model;
import jakarta.persistence.*;
import java.io.Serializable;
import java.util.Objects;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
@Getter
@Setter
@jakarta.persistence.Entity
@@ -35,4 +42,22 @@ public class Function implements IdentityEntity, NamedEntity, Serializable {
@Column(name = "DESCRIPTION", columnDefinition = "VARCHAR(255)")
private String description;
@Override
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
Function that = (Function) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -1,5 +1,13 @@
package com.ecep.contract.model;
import java.time.LocalDate;
import java.util.Objects;
import org.hibernate.annotations.JdbcTypeCode;
import org.hibernate.type.SqlTypes;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
@@ -7,10 +15,6 @@ import jakarta.persistence.Table;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.annotations.JdbcTypeCode;
import org.hibernate.type.SqlTypes;
import java.time.LocalDate;
@Getter
@Setter
@@ -26,4 +30,21 @@ public class HolidayTable {
@Column(name = "IS_HOLIDAY", nullable = false)
private boolean holiday;
@Override
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
HolidayTable that = (HolidayTable) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -5,7 +5,7 @@ import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.AttributeOverride;
import jakarta.persistence.AttributeOverrides;
@@ -23,7 +23,6 @@ import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
/**
* 存货物品清单
*/
@@ -101,17 +100,17 @@ public class Inventory implements IdentityEntity, BasedEntity, Serializable {
* 重量单位
*/
@Column(name = "WEIGHT_UNIT")
private String weightUnit="kg";
private String weightUnit = "kg";
/**
* 体积单位
*/
@Column(name = "VOLUME_UNIT")
private String volumeUnit="";
private String volumeUnit = "";
/**
* 尺寸单位
*/
@Column(name = "VOLUME_SIZE_UNIT")
private String sizeUnit="mm";
private String sizeUnit = "mm";
/**
* 体积尺寸(不含包装)
@@ -136,7 +135,6 @@ public class Inventory implements IdentityEntity, BasedEntity, Serializable {
})
private VolumeSize packagedVolumeSize = new VolumeSize();
/**
* 创建人
*/
@@ -169,17 +167,19 @@ public class Inventory implements IdentityEntity, BasedEntity, Serializable {
@Override
public final boolean equals(Object object) {
if (this == object) return true;
if (object == null) return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy ? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass() : object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
Inventory that = (Inventory) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -1,11 +1,18 @@
package com.ecep.contract.model;
import jakarta.persistence.*;
import java.io.Serializable;
import java.util.Objects;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.proxy.HibernateProxy;
import java.util.Objects;
/**
* 存货分类
@@ -14,7 +21,8 @@ import java.util.Objects;
@Setter
@Entity
@Table(name = "INVENTORY_CATALOG", schema = "supplier_ms")
public class InventoryCatalog implements IdentityEntity, BasedEntity {
public class InventoryCatalog implements IdentityEntity, BasedEntity, Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "ID", nullable = false)
@@ -32,18 +40,17 @@ public class InventoryCatalog implements IdentityEntity, BasedEntity {
}
@Override
public final boolean equals(Object o) {
if (this == o) return true;
if (o == null) return false;
Class<?> oEffectiveClass = o instanceof HibernateProxy ? ((HibernateProxy) o).getHibernateLazyInitializer().getPersistentClass() : o.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
InventoryCatalog that = (InventoryCatalog) o;
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null || HibernateProxyUtils.isNotEffectiveClassEquals(this, object))
return false;
InventoryCatalog that = (InventoryCatalog) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -1,15 +1,26 @@
package com.ecep.contract.model;
import jakarta.persistence.Entity;
import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.proxy.HibernateProxy;
import java.time.Year;
import java.util.Objects;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.AttributeOverride;
import jakarta.persistence.AttributeOverrides;
import jakarta.persistence.Column;
import jakarta.persistence.Embedded;
import jakarta.persistence.Entity;
import jakarta.persistence.FetchType;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.Table;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
@Getter
@Setter
@ToString
@@ -92,18 +103,20 @@ public class InventoryHistoryPrice implements IdentityEntity {
private HistoryPrice maxSalePrice = new HistoryPrice();
@Override
public final boolean equals(Object o) {
if (this == o) return true;
if (o == null) return false;
Class<?> oEffectiveClass = o instanceof HibernateProxy ? ((HibernateProxy) o).getHibernateLazyInitializer().getPersistentClass() : o.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
InventoryHistoryPrice that = (InventoryHistoryPrice) o;
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
InventoryHistoryPrice that = (InventoryHistoryPrice) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -4,9 +4,10 @@ import java.io.Serializable;
import java.time.LocalDate;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import org.springframework.util.StringUtils;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.FetchType;
@@ -71,27 +72,20 @@ public class Invoice implements IdentityEntity, BasedEntity, Serializable {
}
@Override
public final boolean equals(Object o) {
if (this == o)
public final boolean equals(Object object) {
if (this == object)
return true;
if (o == null)
if (object == null)
return false;
Class<?> oEffectiveClass = o instanceof HibernateProxy
? ((HibernateProxy) o).getHibernateLazyInitializer().getPersistentClass()
: o.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass()
: this.getClass();
if (thisEffectiveClass != oEffectiveClass)
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
Invoice invoice = (Invoice) o;
return getId() != null && Objects.equals(getId(), invoice.getId());
}
Invoice that = (Invoice) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode()
: getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -1,7 +1,18 @@
package com.ecep.contract.model;
import java.io.Serializable;
import jakarta.persistence.*;
import java.util.Objects;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.FetchType;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.Table;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
@@ -27,4 +38,22 @@ public class Permission implements IdentityEntity, NamedEntity, Serializable {
@Column(name = "PERMISSION_KEY")
private String key;
@Override
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
Permission that = (Permission) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -3,7 +3,7 @@ package com.ecep.contract.model;
import java.io.Serializable;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -48,22 +48,15 @@ public class ProductType implements BasedEntity, IdentityEntity, Serializable {
return true;
if (object == null)
return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy
? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass()
: object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass()
: this.getClass();
if (thisEffectiveClass != oEffectiveClass)
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
ProductType that = (ProductType) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode()
: getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -3,7 +3,7 @@ package com.ecep.contract.model;
import java.io.Serializable;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -44,17 +44,16 @@ public class ProductUsage implements BasedEntity, IdentityEntity, Serializable {
@Override
public final boolean equals(Object object) {
if (this == object) return true;
if (object == null) return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy ? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass() : object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
if (this == object)
return true;
if (object == null || HibernateProxyUtils.isNotEffectiveClassEquals(this, object))
return false;
ProductUsage that = (ProductUsage) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -5,7 +5,8 @@ import java.time.LocalDate;
import java.util.Objects;
import org.hibernate.annotations.ColumnDefault;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -45,7 +46,6 @@ public class Project implements IdentityEntity, NamedEntity, BasedEntity, Serial
@ToString.Exclude
private Company customer;
/**
* 项目名称
*/
@@ -53,7 +53,9 @@ public class Project implements IdentityEntity, NamedEntity, BasedEntity, Serial
private String name;
/**
* 项目代码,{@link #saleType saleType.Code}+{@link #codeYear}+{@link #codeSequenceNumber codeSequenceNumber} 组成
* 项目代码,{@link #saleType
* saleType.Code}+{@link #codeYear}+{@link #codeSequenceNumber
* codeSequenceNumber} 组成
*/
@Column(name = "CODE")
private String code;
@@ -109,7 +111,6 @@ public class Project implements IdentityEntity, NamedEntity, BasedEntity, Serial
@ToString.Exclude
private ProjectIndustry industry;
/**
* 销售类型
*/
@@ -126,7 +127,6 @@ public class Project implements IdentityEntity, NamedEntity, BasedEntity, Serial
@ToString.Exclude
private ProjectType projectType;
/**
* 产品类型
*/
@@ -135,7 +135,6 @@ public class Project implements IdentityEntity, NamedEntity, BasedEntity, Serial
@ToString.Exclude
private ProductType productType;
/**
* 交货签收方式
* Delivery signature method
@@ -229,7 +228,6 @@ public class Project implements IdentityEntity, NamedEntity, BasedEntity, Serial
@ToString.Exclude
private int version;
@Override
public String toPrettyString() {
return code + " " + name;
@@ -237,17 +235,16 @@ public class Project implements IdentityEntity, NamedEntity, BasedEntity, Serial
@Override
public final boolean equals(Object object) {
if (this == object) return true;
if (object == null) return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy ? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass() : object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
if (this == object)
return true;
if (object == null || HibernateProxyUtils.isNotEffectiveClassEquals(this, object))
return false;
Project project = (Project) object;
return getId() != null && Objects.equals(getId(), project.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -1,9 +1,13 @@
package com.ecep.contract.model;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Objects;
import org.hibernate.annotations.ColumnDefault;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.FetchType;
@@ -27,7 +31,8 @@ import lombok.ToString;
@Entity
@Table(name = "PROJECT_BID")
@ToString
public class ProjectBid implements IdentityEntity, ProjectBasedEntity {
public class ProjectBid implements IdentityEntity, ProjectBasedEntity, Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "ID", nullable = false)
@@ -91,7 +96,6 @@ public class ProjectBid implements IdentityEntity, ProjectBasedEntity {
@Column(name = "NO_STANDARD_CONTRACT_TEXT")
private String noStandardContractText;
/**
* 审核文件
*/
@@ -129,12 +133,24 @@ public class ProjectBid implements IdentityEntity, ProjectBasedEntity {
@Column(name = "AUTHORIZER_DATE")
private LocalDateTime authorizationTime;
/**
* 说明
*/
@Column(name = "DESCRIPTION", columnDefinition = "TEXT")
private String description;
@Override
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null || HibernateProxyUtils.isNotEffectiveClassEquals(this, object))
return false;
ProjectBid projectBid = (ProjectBid) object;
return getId() != null && Objects.equals(getId(), projectBid.getId());
}
@Override
public final int hashCode() {
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -1,10 +1,12 @@
package com.ecep.contract.model;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Objects;
import org.hibernate.annotations.ColumnDefault;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -24,7 +26,8 @@ import lombok.ToString;
@Entity
@Table(name = "PROJECT_COST")
@ToString
public class ProjectCost implements IdentityEntity, ProjectBasedEntity {
public class ProjectCost implements IdentityEntity, ProjectBasedEntity, Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "ID", nullable = false)
@@ -46,7 +49,6 @@ public class ProjectCost implements IdentityEntity, ProjectBasedEntity {
@Column(name = "VER")
private int version;
/**
* 是否标准付款方式
*/
@@ -201,23 +203,21 @@ public class ProjectCost implements IdentityEntity, ProjectBasedEntity {
@Column(name = "DESCRIPTION", columnDefinition = "TEXT")
private String description;
@Column(name = "IMPORT_LOCK")
private boolean importLock;
@Override
public final boolean equals(Object object) {
if (this == object) return true;
if (object == null) return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy ? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass() : object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
ProjectCost that = (ProjectCost) object;
return getId() != null && Objects.equals(getId(), that.getId());
if (this == object)
return true;
if (object == null || HibernateProxyUtils.isNotEffectiveClassEquals(this, object))
return false;
ProjectCost projectCost = (ProjectCost) object;
return getId() != null && Objects.equals(getId(), projectCost.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -4,7 +4,7 @@ import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -138,17 +138,21 @@ public class ProjectCostItem implements IdentityEntity, BasedEntity, Serializabl
@Override
public final boolean equals(Object object) {
if (this == object) return true;
if (object == null) return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy ? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass() : object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
if (this == object) {
return true;
}
if (object == null) {
return false;
}
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
ProjectCostItem that = (ProjectCostItem) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -3,9 +3,8 @@ package com.ecep.contract.model;
import java.io.Serializable;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.ProjectFileType;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -57,15 +56,7 @@ public class ProjectFile implements IdentityEntity, ProjectBasedEntity, Serializ
public final boolean equals(Object object) {
if (this == object)
return true;
if (object == null)
return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy
? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass()
: object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass()
: this.getClass();
if (thisEffectiveClass != oEffectiveClass)
if (object == null || HibernateProxyUtils.isNotEffectiveClassEquals(this, object))
return false;
ProjectFile that = (ProjectFile) object;
return getId() != null && Objects.equals(getId(), that.getId());
@@ -73,8 +64,6 @@ public class ProjectFile implements IdentityEntity, ProjectBasedEntity, Serializ
@Override
public final int hashCode() {
return this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode()
: getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -2,9 +2,8 @@ package com.ecep.contract.model;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.ProjectFileType;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
@@ -20,17 +19,21 @@ import lombok.ToString;
public class ProjectFileTypeLocal extends BaseEnumEntity<ProjectFileType> {
@Override
public final boolean equals(Object object) {
if (this == object) return true;
if (object == null) return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy ? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass() : object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
if (this == object) {
return true;
}
if (object == null) {
return false;
}
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
ProjectFileTypeLocal that = (ProjectFileTypeLocal) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -2,8 +2,10 @@ package com.ecep.contract.model;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Objects;
import com.ecep.contract.ContractPayWay;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -66,7 +68,6 @@ public class ProjectFundPlan implements IdentityEntity, ProjectBasedEntity {
@Column(name = "PAY_TERM")
private String payTerm;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "CONTRACT_PAY_PLAN_ID")
private ContractPayPlan contractPayPlan;
@@ -76,4 +77,24 @@ public class ProjectFundPlan implements IdentityEntity, ProjectBasedEntity {
*/
@Column(name = "UPDATE_TIME")
private LocalDateTime updateDate;
@Override
public boolean equals(Object object) {
if (this == object) {
return true;
}
if (object == null) {
return false;
}
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
ProjectFundPlan that = (ProjectFundPlan) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -3,7 +3,7 @@ package com.ecep.contract.model;
import java.io.Serializable;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -48,17 +48,21 @@ public class ProjectIndustry implements BasedEntity, IdentityEntity, NamedEntity
@Override
public final boolean equals(Object object) {
if (this == object) return true;
if (object == null) return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy ? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass() : object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
if (this == object) {
return true;
}
if (object == null) {
return false;
}
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
ProjectIndustry that = (ProjectIndustry) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -1,9 +1,12 @@
package com.ecep.contract.model;
import java.time.LocalDateTime;
import java.util.Objects;
import org.hibernate.annotations.ColumnDefault;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.FetchType;
@@ -108,4 +111,24 @@ public class ProjectQuotation implements IdentityEntity, ProjectBasedEntity {
@ToString.Exclude
private CompanyCustomerEvaluationFormFile evaluationFile;
@Override
public boolean equals(Object object) {
if (this == object) {
return true;
}
if (object == null) {
return false;
}
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
ProjectQuotation that = (ProjectQuotation) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -2,7 +2,7 @@ package com.ecep.contract.model;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -63,17 +63,21 @@ public class ProjectSaleType implements IdentityEntity, NamedEntity, BasedEntity
@Override
public final boolean equals(Object object) {
if (this == object) return true;
if (object == null) return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy ? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass() : object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
if (this == object) {
return true;
}
if (object == null) {
return false;
}
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
ProjectSaleType that = (ProjectSaleType) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -2,9 +2,8 @@ package com.ecep.contract.model;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.ContractFileType;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -57,26 +56,21 @@ public class ProjectSaleTypeRequireFileType implements IdentityEntity, BasedEnti
@Override
public final boolean equals(Object object) {
if (this == object)
if (this == object) {
return true;
if (object == null)
}
if (object == null) {
return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy
? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass()
: object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass()
: this.getClass();
if (thisEffectiveClass != oEffectiveClass)
}
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
ProjectSaleTypeRequireFileType that = (ProjectSaleTypeRequireFileType) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode()
: getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -3,7 +3,7 @@ package com.ecep.contract.model;
import java.io.Serializable;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -44,17 +44,21 @@ public class ProjectType implements IdentityEntity, NamedEntity, BasedEntity, Se
@Override
public final boolean equals(Object object) {
if (this == object) return true;
if (object == null) return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy ? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass() : object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
if (this == object) {
return true;
}
if (object == null) {
return false;
}
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
ProjectType that = (ProjectType) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -3,7 +3,7 @@ package com.ecep.contract.model;
import java.time.LocalDateTime;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -107,27 +107,22 @@ public class PurchaseBillVoucher implements IdentityEntity, BasedEntity {
}
@Override
public final boolean equals(Object o) {
if (this == o)
public final boolean equals(Object object) {
if (this == object) {
return true;
if (o == null)
}
if (object == null) {
return false;
Class<?> oEffectiveClass = o instanceof HibernateProxy
? ((HibernateProxy) o).getHibernateLazyInitializer().getPersistentClass()
: o.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass()
: this.getClass();
if (thisEffectiveClass != oEffectiveClass)
}
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
PurchaseBillVoucher that = (PurchaseBillVoucher) o;
}
PurchaseBillVoucher that = (PurchaseBillVoucher) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode()
: getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -2,7 +2,7 @@ package com.ecep.contract.model;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -85,28 +85,23 @@ public class PurchaseBillVoucherItem implements IdentityEntity, BasedEntity {
private String description;
@Override
public final boolean equals(Object o) {
if (this == o)
public final boolean equals(Object object) {
if (this == object) {
return true;
if (o == null)
}
if (object == null) {
return false;
Class<?> oEffectiveClass = o instanceof HibernateProxy
? ((HibernateProxy) o).getHibernateLazyInitializer().getPersistentClass()
: o.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass()
: this.getClass();
if (thisEffectiveClass != oEffectiveClass)
}
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
PurchaseBillVoucherItem that = (PurchaseBillVoucherItem) o;
}
PurchaseBillVoucherItem that = (PurchaseBillVoucherItem) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode()
: getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
@Override

View File

@@ -3,7 +3,7 @@ package com.ecep.contract.model;
import java.time.LocalDateTime;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -100,17 +100,19 @@ public class PurchaseOrder implements IdentityEntity, BasedEntity, ContractBased
@Override
public final boolean equals(Object o) {
if (this == o) return true;
if (o == null) return false;
Class<?> oEffectiveClass = o instanceof HibernateProxy ? ((HibernateProxy) o).getHibernateLazyInitializer().getPersistentClass() : o.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
if (this == o)
return true;
if (o == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(o, this)) {
return false;
}
PurchaseOrder that = (PurchaseOrder) o;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -3,7 +3,7 @@ package com.ecep.contract.model;
import java.time.LocalDate;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -74,28 +74,23 @@ public class PurchaseOrderItem implements IdentityEntity, BasedEntity {
private String description;
@Override
public final boolean equals(Object o) {
if (this == o)
public final boolean equals(Object object) {
if (this == object) {
return true;
if (o == null)
}
if (object == null) {
return false;
Class<?> oEffectiveClass = o instanceof HibernateProxy
? ((HibernateProxy) o).getHibernateLazyInitializer().getPersistentClass()
: o.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass()
: this.getClass();
if (thisEffectiveClass != oEffectiveClass)
}
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
PurchaseOrderItem that = (PurchaseOrderItem) o;
}
PurchaseOrderItem that = (PurchaseOrderItem) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode()
: getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
@Override

View File

@@ -3,7 +3,7 @@ package com.ecep.contract.model;
import java.time.LocalDate;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -20,7 +20,7 @@ import lombok.ToString;
/**
* 采购入库单
* 对应 U8 的
* 对应 U8 的 表
*/
@Getter
@Setter
@@ -71,18 +71,22 @@ public class PurchaseReceipt implements IdentityEntity, BasedEntity {
}
@Override
public final boolean equals(Object o) {
if (this == o) return true;
if (o == null) return false;
Class<?> oEffectiveClass = o instanceof HibernateProxy ? ((HibernateProxy) o).getHibernateLazyInitializer().getPersistentClass() : o.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
PurchaseReceipt that = (PurchaseReceipt) o;
public final boolean equals(Object object) {
if (this == object) {
return true;
}
if (object == null) {
return false;
}
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
PurchaseReceipt that = (PurchaseReceipt) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -3,7 +3,7 @@ package com.ecep.contract.model;
import java.time.LocalDate;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -83,18 +83,22 @@ public class PurchaseSettlementVoucher implements IdentityEntity, BasedEntity {
}
@Override
public final boolean equals(Object o) {
if (this == o) return true;
if (o == null) return false;
Class<?> oEffectiveClass = o instanceof HibernateProxy ? ((HibernateProxy) o).getHibernateLazyInitializer().getPersistentClass() : o.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
PurchaseSettlementVoucher that = (PurchaseSettlementVoucher) o;
public final boolean equals(Object object) {
if (this == object) {
return true;
}
if (object == null) {
return false;
}
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
PurchaseSettlementVoucher that = (PurchaseSettlementVoucher) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -2,7 +2,7 @@ package com.ecep.contract.model;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -89,19 +89,23 @@ public class PurchaseSettlementVoucherItem implements IdentityEntity, BasedEntit
private String description;
@Override
public final boolean equals(Object o) {
if (this == o) return true;
if (o == null) return false;
Class<?> oEffectiveClass = o instanceof HibernateProxy ? ((HibernateProxy) o).getHibernateLazyInitializer().getPersistentClass() : o.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
PurchaseSettlementVoucherItem that = (PurchaseSettlementVoucherItem) o;
public final boolean equals(Object object) {
if (this == object) {
return true;
}
if (object == null) {
return false;
}
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
PurchaseSettlementVoucherItem that = (PurchaseSettlementVoucherItem) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
@Override

View File

@@ -3,7 +3,7 @@ package com.ecep.contract.model;
import java.time.LocalDateTime;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -107,27 +107,22 @@ public class SalesBillVoucher implements IdentityEntity, BasedEntity {
}
@Override
public final boolean equals(Object o) {
if (this == o)
public final boolean equals(Object object) {
if (this == object) {
return true;
if (o == null)
}
if (object == null) {
return false;
Class<?> oEffectiveClass = o instanceof HibernateProxy
? ((HibernateProxy) o).getHibernateLazyInitializer().getPersistentClass()
: o.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass()
: this.getClass();
if (thisEffectiveClass != oEffectiveClass)
}
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
SalesBillVoucher that = (SalesBillVoucher) o;
}
SalesBillVoucher that = (SalesBillVoucher) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy
? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode()
: getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -2,7 +2,7 @@ package com.ecep.contract.model;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -60,24 +60,27 @@ public class SalesBillVoucherItem implements IdentityEntity, BasedEntity {
@Column(name = "PRICE")
private double price;
@Column(name = "DESCRIPTION", columnDefinition = "TEXT")
private String description;
@Override
public final boolean equals(Object o) {
if (this == o) return true;
if (o == null) return false;
Class<?> oEffectiveClass = o instanceof HibernateProxy ? ((HibernateProxy) o).getHibernateLazyInitializer().getPersistentClass() : o.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
SalesBillVoucherItem that = (SalesBillVoucherItem) o;
public final boolean equals(Object object) {
if (this == object) {
return true;
}
if (object == null) {
return false;
}
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
SalesBillVoucherItem that = (SalesBillVoucherItem) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
@Override

View File

@@ -3,7 +3,7 @@ package com.ecep.contract.model;
import java.time.LocalDate;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -82,18 +82,20 @@ public class SalesOrder implements IdentityEntity, BasedEntity, ContractBasedEnt
@Override
public final boolean equals(Object o) {
if (this == o) return true;
if (o == null) return false;
Class<?> oEffectiveClass = o instanceof HibernateProxy ? ((HibernateProxy) o).getHibernateLazyInitializer().getPersistentClass() : o.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
if (this == o)
return true;
if (o == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(o, this)) {
return false;
}
SalesOrder that = (SalesOrder) o;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
@Override

View File

@@ -3,7 +3,7 @@ package com.ecep.contract.model;
import java.time.LocalDate;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -76,18 +76,20 @@ public class SalesOrderItem implements IdentityEntity, BasedEntity {
@Override
public final boolean equals(Object o) {
if (this == o) return true;
if (o == null) return false;
Class<?> oEffectiveClass = o instanceof HibernateProxy ? ((HibernateProxy) o).getHibernateLazyInitializer().getPersistentClass() : o.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
if (this == o)
return true;
if (o == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(o, this)) {
return false;
}
SalesOrderItem that = (SalesOrderItem) o;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
@Override

View File

@@ -2,9 +2,12 @@ package com.ecep.contract.model;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Objects;
import org.hibernate.annotations.ColumnDefault;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
@@ -32,4 +35,24 @@ public class SysConf implements Serializable {
@Column(name = "CREATED")
private LocalDateTime created;
@Override
public final boolean equals(Object object) {
if (this == object) {
return true;
}
if (object == null) {
return false;
}
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
SysConf that = (SysConf) object;
return Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -1,8 +1,10 @@
package com.ecep.contract.model;
import java.io.Serializable;
import java.util.Objects;
import com.ecep.contract.UnitType;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.EnumType;
@@ -44,4 +46,24 @@ public class Unit implements IdentityEntity, NamedEntity, Serializable {
@Column(name = "STANDARD")
private boolean standard;
@Override
public final boolean equals(Object object) {
if (this == object) {
return true;
}
if (object == null) {
return false;
}
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
Unit that = (Unit) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -3,9 +3,8 @@ package com.ecep.contract.model;
import java.io.Serializable;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.VendorType;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -51,17 +50,16 @@ public class VendorCatalog implements BasedEntity, Serializable {
@Override
public final boolean equals(Object object) {
if (this == object) return true;
if (object == null) return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy ? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass() : object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
if (this == object)
return true;
if (object == null || HibernateProxyUtils.isNotEffectiveClassEquals(this, object))
return false;
VendorCatalog that = (VendorCatalog) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -2,7 +2,7 @@ package com.ecep.contract.model;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -63,17 +63,19 @@ public class VendorGroup implements IdentityEntity, NamedEntity, BasedEntity {
@Override
public final boolean equals(Object object) {
if (this == object) return true;
if (object == null) return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy ? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass() : object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
VendorGroup that = (VendorGroup) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -2,9 +2,8 @@ package com.ecep.contract.model;
import java.util.Objects;
import org.hibernate.proxy.HibernateProxy;
import com.ecep.contract.ContractFileType;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -57,17 +56,19 @@ public class VendorGroupRequireFileType implements IdentityEntity, BasedEntity {
@Override
public final boolean equals(Object object) {
if (this == object) return true;
if (object == null) return false;
Class<?> oEffectiveClass = object instanceof HibernateProxy ? ((HibernateProxy) object).getHibernateLazyInitializer().getPersistentClass() : object.getClass();
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
if (thisEffectiveClass != oEffectiveClass) return false;
if (this == object)
return true;
if (object == null)
return false;
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
VendorGroupRequireFileType that = (VendorGroupRequireFileType) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
return HibernateProxyUtils.hashCode(this);
}
}

View File

@@ -1,6 +1,9 @@
package com.ecep.contract.model;
import java.util.Objects;
import com.ecep.contract.VendorType;
import com.ecep.contract.util.HibernateProxyUtils;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
@@ -17,4 +20,24 @@ import lombok.ToString;
@Table(name = "VENDOR_TYPE_LOCAL")
@ToString(callSuper = true)
public class VendorTypeLocal extends BaseEnumEntity<VendorType> {
@Override
public final boolean equals(Object object) {
if (this == object) {
return true;
}
if (object == null) {
return false;
}
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
return false;
}
VendorTypeLocal that = (VendorTypeLocal) object;
return getId() != null && Objects.equals(getId(), that.getId());
}
@Override
public final int hashCode() {
return HibernateProxyUtils.hashCode(this);
}
}