bugfix: 修改bug#I7I08X

修改equals和hashcode,加入属性所在类名,方便后续扩展使用
自测完成
This commit is contained in:
yaochen4 2023-07-03 18:23:18 +08:00
parent 7dda5963b1
commit 113a73d170
2 changed files with 13 additions and 2 deletions

View File

@ -300,6 +300,7 @@ public class MybatisFlexProcessor extends AbstractProcessor {
columnInfo.setProperty(property); columnInfo.setProperty(property);
columnInfo.setColumn(columnName); columnInfo.setColumn(columnName);
columnInfo.setAlias(alias); columnInfo.setAlias(alias);
columnInfo.setFullClassName(baseElement.getQualifiedName().toString());
columnInfoList.add(columnInfo); columnInfoList.add(columnInfo);

View File

@ -41,6 +41,8 @@ public class ColumnInfo {
*/ */
private String[] alias; private String[] alias;
private String fullClassName;
public String getProperty() { public String getProperty() {
return property; return property;
} }
@ -65,16 +67,24 @@ public class ColumnInfo {
this.alias = alias; this.alias = alias;
} }
public String getFullClassName() {
return fullClassName;
}
public void setFullClassName(String fullClassName) {
this.fullClassName = fullClassName;
}
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) return true; if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false; if (o == null || getClass() != o.getClass()) return false;
ColumnInfo that = (ColumnInfo) o; ColumnInfo that = (ColumnInfo) o;
return Objects.equals(property, that.property); return Objects.equals(property, that.property) && Objects.equals(fullClassName, that.fullClassName);
} }
@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hash(property); return Objects.hash(property, fullClassName);
} }
} }