Search in sources :

Example 1 with QualifiedRecord

use of org.jooq.QualifiedRecord in project jOOQ by jOOQ.

the class DefaultBinding method typeMap.

@SuppressWarnings("unchecked")
static final Map<String, Class<?>> typeMap(Class<?> type, Scope scope, Map<String, Class<?>> result) {
    try {
        if (QualifiedRecord.class.isAssignableFrom(type)) {
            Class<QualifiedRecord<?>> t = (Class<QualifiedRecord<?>>) type;
            result.put(getMappedUDTName(scope, t), t);
            QualifiedRecord<?> r = t.getDeclaredConstructor().newInstance();
            for (Field<?> field : r.getQualifier().fields()) typeMap(field.getType(), scope, result);
        }
    } catch (Exception e) {
        throw new MappingException("Error while collecting type map", e);
    }
    return result;
}
Also used : QualifiedRecord(org.jooq.QualifiedRecord) Reflect.onClass(org.jooq.tools.reflect.Reflect.onClass) DataTypeException(org.jooq.exception.DataTypeException) SQLDialectNotSupportedException(org.jooq.exception.SQLDialectNotSupportedException) SQLException(java.sql.SQLException) MappingException(org.jooq.exception.MappingException) MappingException(org.jooq.exception.MappingException)

Aggregations

SQLException (java.sql.SQLException)1 QualifiedRecord (org.jooq.QualifiedRecord)1 DataTypeException (org.jooq.exception.DataTypeException)1 MappingException (org.jooq.exception.MappingException)1 SQLDialectNotSupportedException (org.jooq.exception.SQLDialectNotSupportedException)1 Reflect.onClass (org.jooq.tools.reflect.Reflect.onClass)1