View Javadoc

1   /**
2    * Copyright 2011 The Kuali Foundation Licensed under the
3    * Educational Community License, Version 2.0 (the "License"); you may
4    * not use this file except in compliance with the License. You may
5    * obtain a copy of the License at
6    *
7    * http://www.osedu.org/licenses/ECL-2.0
8    *
9    * Unless required by applicable law or agreed to in writing,
10   * software distributed under the License is distributed on an "AS IS"
11   * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12   * or implied. See the License for the specific language governing
13   * permissions and limitations under the License.
14   */
15  
16  package org.kuali.common.impex.schema.impl.mysql;
17  
18  import java.util.List;
19  
20  import org.kuali.common.impex.model.ForeignKey;
21  import org.kuali.common.impex.model.Sequence;
22  import org.kuali.common.impex.model.Table;
23  import org.kuali.common.impex.model.View;
24  import org.kuali.common.impex.schema.impl.AbstractSchemaSqlProducer;
25  import org.kuali.common.impex.schema.impl.NoOpProvider;
26  
27  public class MySqlSchemaProducer extends AbstractSchemaSqlProducer {
28  
29      private MySqlTableSqlProducer tableSqlProducer = new MySqlTableSqlProducer();
30  
31      private MySqlViewSqlProducer viewSqlProducer = new MySqlViewSqlProducer();
32  
33      private MySqlSequenceSqlProducer sequenceSqlProducer = new MySqlSequenceSqlProducer();
34  
35      private MySqlForeignKeySqlProducer foreignKeySqlProducer = new MySqlForeignKeySqlProducer();
36  
37      public MySqlSchemaProducer() {
38          tableSqlProducer.setMappingProvider(new NoOpProvider());
39      }
40  
41      public MySqlTableSqlProducer getTableSqlProducer() {
42          return tableSqlProducer;
43      }
44  
45      @Override
46      public List<String> getTablesSql(List<Table> tables) {
47          return tableSqlProducer.getTablesSql(tables);
48      }
49  
50      @Override
51      public List<String> getForeignKeySql(List<ForeignKey> foreignKeys) {
52          return foreignKeySqlProducer.getForeignKeySql(foreignKeys);
53      }
54  
55      @Override
56      public List<String> getSequencesSql(List<Sequence> sequences) {
57          return sequenceSqlProducer.getSequencesSql(sequences);
58      }
59  
60      @Override
61      public List<String> getViewsSql(List<View> views) {
62          return viewSqlProducer.getViewsSql(views);
63      }
64  }