|
| 1 | +/* |
| 2 | + * Copyright © Magento, Inc. All rights reserved. |
| 3 | + * See COPYING.txt for license details. |
| 4 | + */ |
| 5 | + |
| 6 | +package com.magento.idea.magento2plugin.actions.generation.data; |
| 7 | + |
| 8 | +import java.util.Arrays; |
| 9 | +import java.util.LinkedList; |
| 10 | +import java.util.List; |
| 11 | + |
| 12 | +public final class DbSchemaXmlSourceData { |
| 13 | + // currently available engines |
| 14 | + public static final String TABLE_ENGINE_INNODB = "innodb"; |
| 15 | + public static final String TABLE_ENGINE_MEMORY = "memory"; |
| 16 | + // currently available resources |
| 17 | + public static final String TABLE_RESOURCE_DEFAULT = "default"; |
| 18 | + public static final String TABLE_RESOURCE_CHECKOUT = "checkout"; |
| 19 | + public static final String TABLE_RESOURCE_SALES = "sales"; |
| 20 | + // available column types |
| 21 | + // binaries |
| 22 | + public static final String COLUMN_TYPE_BLOB = "blob"; |
| 23 | + public static final String COLUMN_TYPE_MEDIUMBLOB = "mediumblob"; |
| 24 | + public static final String COLUMN_TYPE_LONGBLOB = "longblob"; |
| 25 | + public static final String COLUMN_TYPE_VARBINARY = "varbinary"; |
| 26 | + // integers |
| 27 | + public static final String COLUMN_TYPE_TINYINT = "tinyint"; |
| 28 | + public static final String COLUMN_TYPE_SMALLINT = "smallint"; |
| 29 | + public static final String COLUMN_TYPE_INT = "int"; |
| 30 | + public static final String COLUMN_TYPE_BIGINT = "bigint"; |
| 31 | + // reals |
| 32 | + public static final String COLUMN_TYPE_DECIMAL = "decimal"; |
| 33 | + public static final String COLUMN_TYPE_DOUBLE = "double"; |
| 34 | + public static final String COLUMN_TYPE_FLOAT = "float"; |
| 35 | + // text |
| 36 | + public static final String COLUMN_TYPE_VARCHAR = "varchar"; |
| 37 | + public static final String COLUMN_TYPE_TEXT = "text"; |
| 38 | + public static final String COLUMN_TYPE_MEDIUMTEXT = "mediumtext"; |
| 39 | + public static final String COLUMN_TYPE_LONGTEXT = "longtext"; |
| 40 | + // boolean |
| 41 | + public static final String COLUMN_TYPE_BOOLEAN = "boolean"; |
| 42 | + |
| 43 | + /** |
| 44 | + * Denying the possibility to initialize this class. |
| 45 | + */ |
| 46 | + private DbSchemaXmlSourceData() {} |
| 47 | + |
| 48 | + /** |
| 49 | + * Get source list for available table engines. |
| 50 | + * |
| 51 | + * @return List |
| 52 | + */ |
| 53 | + public static List<String> getTableEngineSource() { |
| 54 | + return new LinkedList<>(Arrays.asList( |
| 55 | + DbSchemaXmlSourceData.TABLE_ENGINE_INNODB, |
| 56 | + DbSchemaXmlSourceData.TABLE_ENGINE_MEMORY) |
| 57 | + ); |
| 58 | + } |
| 59 | + |
| 60 | + /** |
| 61 | + * Get source list for available table resources. |
| 62 | + * |
| 63 | + * @return List |
| 64 | + */ |
| 65 | + public static List<String> getTableResourceSource() { |
| 66 | + return new LinkedList<>(Arrays.asList( |
| 67 | + TABLE_RESOURCE_DEFAULT, |
| 68 | + TABLE_RESOURCE_CHECKOUT, |
| 69 | + TABLE_RESOURCE_SALES |
| 70 | + )); |
| 71 | + } |
| 72 | + |
| 73 | + /** |
| 74 | + * Get source list for available column types. |
| 75 | + * |
| 76 | + * @return List |
| 77 | + */ |
| 78 | + public static List<String> getColumnTypes() { |
| 79 | + return new LinkedList<>(Arrays.asList( |
| 80 | + "", |
| 81 | + COLUMN_TYPE_BLOB, |
| 82 | + COLUMN_TYPE_MEDIUMBLOB, |
| 83 | + COLUMN_TYPE_LONGBLOB, |
| 84 | + COLUMN_TYPE_VARBINARY, |
| 85 | + COLUMN_TYPE_TINYINT, |
| 86 | + COLUMN_TYPE_SMALLINT, |
| 87 | + COLUMN_TYPE_INT, |
| 88 | + COLUMN_TYPE_BIGINT, |
| 89 | + COLUMN_TYPE_DECIMAL, |
| 90 | + COLUMN_TYPE_DOUBLE, |
| 91 | + COLUMN_TYPE_FLOAT, |
| 92 | + COLUMN_TYPE_VARCHAR, |
| 93 | + COLUMN_TYPE_TEXT, |
| 94 | + COLUMN_TYPE_MEDIUMTEXT, |
| 95 | + COLUMN_TYPE_LONGTEXT, |
| 96 | + COLUMN_TYPE_BOOLEAN |
| 97 | + )); |
| 98 | + } |
| 99 | +} |
0 commit comments