Skip to content

AttributeConverter only supports wrapped String/Long #15

@tblakers

Description

@tblakers

My domain model contains inline classes wrapping UUIDs. I'd like to be able to store these using the native Postgres UUID type, and this is allowed by JPA AttributeConverter class. Unfortunately the processor requires the target type to be either a Long or a String.

    private fun converterFunc(name: String, type: TypeName, it: ConverterDefinition, fileSpec: FileSpec.Builder) {
        val wrapperName = when (it.targetType.asClassName()) {
            STRING -> "stringWrapper"
            LONG -> "longWrapper"
            else -> throw TypeConverterNotSupportedException(it.targetType)
        }

Is there any particular reason for this, and if not would you accept a PR that adds UUID as an option?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions