|
|
@@ -7,6 +7,8 @@ import org.mongodb.morphia.annotations.Entity;
|
|
|
import org.mongodb.morphia.annotations.IndexOptions;
|
|
|
import org.mongodb.morphia.annotations.Indexed;
|
|
|
|
|
|
+import java.util.Objects;
|
|
|
+
|
|
|
/**
|
|
|
* 数据源
|
|
|
*
|
|
|
@@ -101,4 +103,17 @@ public class DataSource extends BaseEntity {
|
|
|
"} " + super.toString();
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public boolean equals(Object obj) {
|
|
|
+ if (this == obj) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ if (obj == null || getClass() != obj.getClass() || !(obj instanceof DataSource)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ DataSource other = (DataSource) obj;
|
|
|
+ return Objects.equals(code, other.getCode()) && Objects.equals(name, other.getName())
|
|
|
+ && Objects.equals(driverClassName, other.getDriverClassName()) && Objects.equals(url, other.getUrl())
|
|
|
+ && Objects.equals(username, other.getUsername()) && Objects.equals(password, other.getPassword());
|
|
|
+ }
|
|
|
}
|