[jOOQ/jOOQ#10524] Add DataType.isEmbeddable()

This commit is contained in:
Lukas Eder 2020-08-25 13:26:41 +02:00
parent d8eac6cc60
commit fdc05e3349
2 changed files with 11 additions and 0 deletions

View File

@ -770,6 +770,11 @@ public interface DataType<T> extends Named {
*/
boolean isArray();
/**
* Whether this data type is an embeddable type.
*/
boolean isEmbeddable();
/**
* Whether this data type is a UDT type.
*/

View File

@ -76,6 +76,7 @@ import org.jooq.Context;
import org.jooq.Converter;
import org.jooq.DataType;
import org.jooq.Domain;
import org.jooq.EmbeddableRecord;
import org.jooq.EnumType;
import org.jooq.Field;
import org.jooq.JSON;
@ -656,6 +657,11 @@ abstract class AbstractDataType<T> extends AbstractNamed implements DataType<T>
(!isBinary() && tType.isArray());
}
@Override
public final boolean isEmbeddable() {
return EmbeddableRecord.class.isAssignableFrom(tType0());
}
@Override
public final boolean isUDT() {
return UDTRecord.class.isAssignableFrom(tType0());