strongduanmu commented on code in PR #20689:
URL: https://github.com/apache/shardingsphere/pull/20689#discussion_r959510905


##########
shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/metadata/database/schema/decorator/model/ShardingSphereSchema.java:
##########
@@ -53,34 +58,64 @@ public Collection<String> getAllTableNames() {
         return tables.keySet();
     }
     
+    /**
+     * Get all view names.
+     *
+     * @return all view names
+     */
+    public Collection<String> getAllViewNames() {
+        return views.keySet();
+    }
+    
     /**
      * Get table meta data via table name.
      * 
      * @param tableName tableName table name
      * @return table meta data
      */
-    public ShardingSphereTable get(final String tableName) {
+    public ShardingSphereTable getTable(final String tableName) {
         return tables.get(tableName.toLowerCase());
     }
     
+    /**
+     * Get view meta data via view name.
+     *
+     * @param viewName viewName view name
+     * @return view meta data
+     */
+    public ShardingSphereView getView(final String viewName) {
+        return views.get(viewName.toLowerCase());
+    }
+    
     /**
      * Add table.
      * 
      * @param tableName table name
      * @param table table
      */
-    public void put(final String tableName, final ShardingSphereTable table) {
+    public void putTable(final String tableName, final ShardingSphereTable 
table) {
         tables.put(tableName.toLowerCase(), table);
     }
     
+    /**
+     * Add view.
+     *
+     * @param viewName view name
+     * @param view view
+     */
+    public void putView(final String viewName, final ShardingSphereView view) {
+        views.put(viewName.toLowerCase(), view);
+    }
+    
     /**
      * Add tables.
      *
+     *

Review Comment:
   Please remove this useless black line.



##########
shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/metadata/database/schema/loader/model/ViewMetaData.java:
##########
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.infra.metadata.database.schema.loader.model;
+
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.RequiredArgsConstructor;
+import lombok.ToString;
+
+/**
+ * Table meta data.

Review Comment:
   Please rename `Table meta data` to `View meta data`.



##########
shardingsphere-infra/shardingsphere-infra-context/src/main/java/org/apache/shardingsphere/infra/context/refresher/type/DropViewStatementSchemaRefresher.java:
##########
@@ -39,8 +39,9 @@ public final class DropViewStatementSchemaRefresher 
implements MetaDataRefresher
     public Optional<MetaDataRefreshedEvent> refresh(final 
ShardingSphereDatabase database, final Collection<String> logicDataSourceNames,
                                                     final String schemaName, 
final DropViewStatement sqlStatement, final ConfigurationProperties props) 
throws SQLException {
         SchemaAlteredEvent event = new SchemaAlteredEvent(database.getName(), 
schemaName);
+        // TODO Drop view meta data from ShardingSphereSchema 's views

Review Comment:
   Do you think `ShardingSphereSchema's views` is better?



##########
shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/metadata/database/schema/decorator/model/ShardingSphereSchema.java:
##########
@@ -53,34 +58,64 @@ public Collection<String> getAllTableNames() {
         return tables.keySet();
     }
     
+    /**
+     * Get all view names.
+     *
+     * @return all view names
+     */
+    public Collection<String> getAllViewNames() {

Review Comment:
   Does all view names are lowercase?



-- 
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]

Reply via email to