# transform

fun <Unwrapped, Wrapped> Column<Unwrapped>.transform(transformer: ColumnTransformer<Unwrapped, Wrapped>): EntityFieldWithTransform<Unwrapped, Wrapped>

### Deprecated

This function was replaced with more general alternative on DSL layer. DAOs transform() is deprecated and will be removed in future releases. Please use the transform function from the DSL layer. Please log a request on YouTrack (https://youtrack.jetbrains.com/newIssue?project=EXPOSED) if a use-case cannot be sufficiently covered by the DSL transform(). With version 0.53.0 Entity transformation got several breaking changes. Check related PR (https://github.com/JetBrains/Exposed/pull/2143) for more details.

#### Replace with

    object : Table() { val c = column().transform(transformer) }

Content copied to clipboard

Returns a EntityFieldWithTransform delegate that transforms this stored Unwrapped value on every read.

#### Parameters

transformer

An instance of ColumnTransformer to handle the transformations.

#### Samples

org.jetbrains.exposed.sql.tests.shared.entities.TransformationsTableorg.jetbrains.exposed.sql.tests.shared.entities.TransformationEntity

fun <Unwrapped, Wrapped> Column<Unwrapped>.transform(unwrap: (Wrapped) -> Unwrapped, wrap: (Unwrapped) -> Wrapped): EntityFieldWithTransform<Unwrapped, Wrapped>

### Deprecated

This function was replaced with more general alternative on DSL layer. DAOs transform() is deprecated and will be removed in future releases. Please use the transform function from the DSL layer. Please log a request on YouTrack (https://youtrack.jetbrains.com/newIssue?project=EXPOSED) if a use-case cannot be sufficiently covered by the DSL transform(). With version 0.53.0 Entity transformation got several breaking changes. Check related PR (https://github.com/JetBrains/Exposed/pull/2143) for more details.

#### Replace with

    object : Table() { val c = column().transform(wrap, unwrap) }

Content copied to clipboard

Returns a EntityFieldWithTransform delegate that transforms this stored Unwrapped value on every read.

#### Parameters

unwrap

A pure function that converts a transformed value to a value that can be stored in this original column type.

wrap

A pure function that transforms a value stored in this original column type.

#### Samples

org.jetbrains.exposed.sql.tests.shared.entities.TransformationsTableorg.jetbrains.exposed.sql.tests.shared.entities.TransformationEntity

fun <TColumn, Unwrapped, Wrapped> EntityFieldWithTransform<TColumn, Unwrapped>.transform(unwrap: (Wrapped) -> Unwrapped, wrap: (Unwrapped) -> Wrapped): EntityFieldWithTransform<TColumn, Wrapped>

### Deprecated

This function was replaced with more general alternative on DSL layer. DAOs transform() is deprecated and will be removed in future releases. Please use the transform function from the DSL layer. Please log a request on YouTrack (https://youtrack.jetbrains.com/newIssue?project=EXPOSED) if a use-case cannot be sufficiently covered by the DSL transform(). With version 0.53.0 Entity transformation got several breaking changes. Check related PR (https://github.com/JetBrains/Exposed/pull/2143) for more details.

#### Replace with

    object : Table() { val c = column().transform(wrap, unwrap) }

Content copied to clipboard

Returns a EntityFieldWithTransform that extends transformation of existing EntityFieldWithTransform.

#### Parameters

unwrap

A function that transforms the value to the wrapping type of previously defined transformation

wrap

A function that transforms value to the wrapping type

#### Samples

org.jetbrains.exposed.sql.tests.shared.entities.TransformationsTableorg.jetbrains.exposed.sql.tests.shared.entities.TransformationEntity