[jOOQ/jOOQ#18732] Add DataType::isQualifiedRecord and DataType::isUDTRecord

This commit is contained in:
Lukas Eder 2025-07-04 13:08:30 +02:00
parent d09bf49206
commit 614a7dd11b
2 changed files with 28 additions and 0 deletions

View File

@ -1577,9 +1577,26 @@ public interface DataType<T> extends Named {
/**
* Whether this data type is a UDT type.
* <p>
* It is recommended to use {@link #isQualifiedRecord()} instead, which
* returns the same thing as {@link #isUDT()}, or {@link #isUDTRecord()} if
* only actual {@link UDT} types are requested.
*/
boolean isUDT();
/**
* Whether this data type is a {@link UDTRecord} type.
*/
boolean isUDTRecord();
/**
* Whether this data type is a {@link QualifiedRecord} type.
* <p>
* This includes {@link UDT#getDataType()} as well as
* {@link Table#getDataType()}.
*/
boolean isQualifiedRecord();
/**
* Whether this data type is a nested record type.
* <p>

View File

@ -138,6 +138,7 @@ import org.jooq.RowId;
import org.jooq.SQLDialect;
import org.jooq.Schema;
import org.jooq.Table;
import org.jooq.UDTRecord;
import org.jooq.XML;
import org.jooq.impl.QOM.GenerationLocation;
import org.jooq.impl.QOM.GenerationOption;
@ -1038,8 +1039,18 @@ implements
return EmbeddableRecord.class.isAssignableFrom(tType0());
}
@Override
public final boolean isUDTRecord() {
return UDTRecord.class.isAssignableFrom(tType0());
}
@Override
public final boolean isUDT() {
return isQualifiedRecord();
}
@Override
public final boolean isQualifiedRecord() {
return QualifiedRecord.class.isAssignableFrom(tType0());
}