Search in sources :

Example 1 with EnumType

use of org.jooq.meta.jaxb.EnumType in project jOOQ by jOOQ.

the class AbstractDatabase method getConfiguredEnums.

private final List<EnumDefinition> getConfiguredEnums() {
    List<EnumDefinition> result = new ArrayList<>(getConfiguredEnumTypes().size());
    for (EnumType enumType : getConfiguredEnumTypes()) {
        String name = enumType.getName();
        DefaultEnumDefinition e = new DefaultEnumDefinition(getSchemata().get(0), name, null, true);
        String literals = enumType.getLiterals();
        try {
            CSVReader reader = new CSVReader(new StringReader(literals));
            e.addLiterals(reader.readNext());
        } catch (IOException ignore) {
        }
        result.add(e);
    }
    return result;
}
Also used : CSVReader(org.jooq.tools.csv.CSVReader) EnumType(org.jooq.meta.jaxb.EnumType) ArrayList(java.util.ArrayList) StringReader(java.io.StringReader) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)1 StringReader (java.io.StringReader)1 ArrayList (java.util.ArrayList)1 EnumType (org.jooq.meta.jaxb.EnumType)1 CSVReader (org.jooq.tools.csv.CSVReader)1