feat: 添加日志配置和Logback依赖
refactor: 重构实体类equals和hashCode方法 fix: 修复WebSocketService消息发送逻辑 style: 格式化代码和优化导入 docs: 更新JacksonConfig日期序列化格式 test: 添加CompanyFilePathTableCell测试类 chore: 清理无用代码和注释
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user