Interface SqlColumnDefinitionProvider
- All Superinterfaces:
DefinitionProvider
- All Known Subinterfaces:
ByteVectorAttributeConverter<X>, DoubleVectorAttributeConverter<X>, FloatVectorAttributeConverter<X>, SparseByteVectorAttributeConverter<X>, SparseDoubleVectorAttributeConverter<X>, SparseFloatVectorAttributeConverter<X>, VectorAttributeConverter<X>
Extension interface to provide vendor-specific SQL column definitions during schema generation.
Implementations are internal Micronaut beans discovered by schema utilities and are not intended as a stable user extension point.
- Since:
- 5.0.0
-
Method Summary
Modifier and TypeMethodDescription@Nullable StringgetColumnDefinition(io.micronaut.core.type.Argument<?> argument, DatabaseType databaseType) Return a vendor-specific SQL column definition for this attribute, ornullto delegate to default mapping.booleansupports(io.micronaut.core.type.Argument<?> argument) Whether this provider can handle the given attribute.
-
Method Details
-
getColumnDefinition
@Nullable String getColumnDefinition(io.micronaut.core.type.Argument<?> argument, DatabaseType databaseType) Return a vendor-specific SQL column definition for this attribute, ornullto delegate to default mapping.Implementations should inspect the provided
Argumentto extract length/precision/scale and relevant annotations (e.g.@jakarta.persistence.Column,@jakarta.validation.constraints.Size) and produce a dialect-specific column type.- Parameters:
argument- the MicronautArgumentdescribing the attribute (type + annotations)databaseType- the canonical database type for which a definition should be produced- Returns:
- the SQL column definition string, or
nullto allow default resolution
-
supports
boolean supports(io.micronaut.core.type.Argument<?> argument) Whether this provider can handle the given attribute.- Parameters:
argument- the attribute argument- Returns:
- true if this provider can generate a column definition for the given argument
-