Package org.jooq.util

Examples of org.jooq.util.DefaultEnumDefinition


                ColumnDefinition columnDefinition = tableDefinition.getColumn(column);

                // [#1137] Avoid generating enum classes for enum types that
                // are explicitly forced to another type
                if (getConfiguredForcedType(columnDefinition) == null) {
                    DefaultEnumDefinition definition = new DefaultEnumDefinition(getSchemata().get(0), name, "");
                    for (String string : columnType.replaceAll("ENUM\\(|\\)", "").split(",")) {
                        definition.addLiteral(string.trim().replaceAll("'", ""));
                    }

                    result.add(definition);
                }
            }
View Full Code Here


            for (Record2<String, String> type : types) {
                String nspname = type.getValue(PG_NAMESPACE.NSPNAME);
                String typname = type.getValue(PG_TYPE.TYPNAME);

                DefaultEnumDefinition definition = null;
                for (String label : enumLabels(nspname, typname)) {
                    SchemaDefinition schema = getSchema(nspname);
                    String typeName = String.valueOf(typname);

                    if (definition == null || !definition.getName().equals(typeName)) {
                        definition = new DefaultEnumDefinition(schema, typeName, null);
                        result.add(definition);
                    }

                    definition.addLiteral(label);
                }
            }
        }

        return result;
View Full Code Here

                if (columnDefinition != null) {

                  // [#1137] Avoid generating enum classes for enum types that
                  // are explicitly forced to another type
                    if (getConfiguredForcedType(columnDefinition) == null) {
                        DefaultEnumDefinition definition = new DefaultEnumDefinition(schema, name, comment);

                        CSVReader reader = new CSVReader(
                            new StringReader(columnType.replaceAll("(^enum\\()|(\\)$)", ""))
                           ,','  // Separator
                           ,'\'' // Quote character
                           ,true // Strict quotes
                        );

                        for (String string : reader.next()) {
                            definition.addLiteral(string);
                        }

                        result.add(definition);
                    }
                }
View Full Code Here

                PG_NAMESPACE.NSPNAME,
                PG_TYPE.TYPNAME,
                PG_ENUM.ENUMLABEL)
            .fetch();

        DefaultEnumDefinition definition = null;
        for (Record record : records) {
            SchemaDefinition schema = getSchema(record.getValue(PG_NAMESPACE.NSPNAME));
            String typeName = String.valueOf(record.getValue(PG_TYPE.TYPNAME));

            if (definition == null || !definition.getName().equals(typeName)) {
                definition = new DefaultEnumDefinition(schema, typeName, null);
                result.add(definition);
            }

            definition.addLiteral(String.valueOf(record.getValue(PG_ENUM.ENUMLABEL)));
        }

        return result;
    }
View Full Code Here

                if (columnDefinition != null) {

                  // [#1137] Avoid generating enum classes for enum types that
                  // are explicitly forced to another type
                    if (getConfiguredForcedType(columnDefinition) == null) {
                        DefaultEnumDefinition definition = new DefaultEnumDefinition(schema, name, comment);
                        for (String string : columnType.replaceAll("enum\\(|\\)", "").split(",")) {
                            definition.addLiteral(string.trim().replaceAll("'", ""));
                        }

                        result.add(definition);
                    }
                }
View Full Code Here

TOP

Related Classes of org.jooq.util.DefaultEnumDefinition

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.