jerryshao commented on code in PR #10879:
URL: https://github.com/apache/gravitino/pull/10879#discussion_r3160576854
##########
core/src/main/java/org/apache/gravitino/storage/relational/po/ViewPO.java:
##########
@@ -18,23 +18,119 @@
*/
package org.apache.gravitino.storage.relational.po;
+import static
org.apache.gravitino.storage.relational.utils.POConverters.DEFAULT_DELETED_AT;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.type.CollectionType;
import com.google.common.base.Preconditions;
-import lombok.EqualsAndHashCode;
-import lombok.Getter;
-import lombok.ToString;
+import com.google.common.collect.ImmutableMap;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.stream.Collectors;
+import org.apache.gravitino.Entity;
+import org.apache.gravitino.NameIdentifier;
+import org.apache.gravitino.Namespace;
+import org.apache.gravitino.dto.rel.ColumnDTO;
+import org.apache.gravitino.json.JsonUtils;
+import org.apache.gravitino.meta.AuditInfo;
+import org.apache.gravitino.meta.NamespacedEntityId;
+import org.apache.gravitino.meta.ViewEntity;
+import org.apache.gravitino.rel.Column;
+import org.apache.gravitino.rel.Representation;
+import org.apache.gravitino.rel.SQLRepresentation;
+import org.apache.gravitino.storage.relational.service.EntityIdService;
-@Getter
-@EqualsAndHashCode
-@ToString
public class ViewPO {
+
+ public static final Long INITIAL_VERSION = 1L;
+
private Long viewId;
private String viewName;
private Long metalakeId;
private Long catalogId;
private Long schemaId;
+ private String auditInfo;
private Long currentVersion;
private Long lastVersion;
private Long deletedAt;
+ private ViewVersionInfoPO viewVersionInfoPO;
+
+ public Long getViewId() {
+ return viewId;
+ }
+
+ public String getViewName() {
+ return viewName;
+ }
+
+ public Long getMetalakeId() {
+ return metalakeId;
+ }
+
+ public Long getCatalogId() {
+ return catalogId;
+ }
+
+ public Long getSchemaId() {
+ return schemaId;
+ }
+
+ public String getAuditInfo() {
+ return auditInfo;
+ }
+
+ public Long getCurrentVersion() {
+ return currentVersion;
+ }
+
+ public Long getLastVersion() {
+ return lastVersion;
+ }
+
+ public Long getDeletedAt() {
+ return deletedAt;
+ }
+
+ public ViewVersionInfoPO getViewVersionInfoPO() {
+ return viewVersionInfoPO;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof ViewPO)) {
+ return false;
+ }
+ ViewPO other = (ViewPO) o;
+ return Objects.equals(viewId, other.viewId)
+ && Objects.equals(viewName, other.viewName)
+ && Objects.equals(metalakeId, other.metalakeId)
+ && Objects.equals(catalogId, other.catalogId)
+ && Objects.equals(schemaId, other.schemaId)
+ && Objects.equals(auditInfo, other.auditInfo)
+ && Objects.equals(currentVersion, other.currentVersion)
+ && Objects.equals(lastVersion, other.lastVersion)
+ && Objects.equals(deletedAt, other.deletedAt);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(
+ viewId,
+ viewName,
+ metalakeId,
+ catalogId,
+ schemaId,
+ auditInfo,
+ currentVersion,
+ lastVersion,
+ deletedAt);
+ }
public static class Builder {
Review Comment:
Lombok can also generate the `Builder`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]