Skip to content
This repository was archived by the owner on Nov 26, 2020. It is now read-only.

Mapping of UUID to String error #17

Open
AlehGalo opened this issue May 18, 2020 · 1 comment
Open

Mapping of UUID to String error #17

AlehGalo opened this issue May 18, 2020 · 1 comment
Labels
question Further information is requested

Comments

@AlehGalo
Copy link

AlehGalo commented May 18, 2020

I have an issue with Kotlin -> kapt -> mapstruct

I have 2 data classes

@entity(name = "PLAN")
@typedef(name = "pgsql_enum",
typeClass = PostgreSQLEnumType::class)
@KotlinBuilder
data class Plan(

    @Id
    @GeneratedValue(generator = "UUID")
    @GenericGenerator(name = "UUID", strategy = "org.hibernate.id.UUIDGenerator")
    @JsonProperty("uuid")
    val uuid: UUID? = null,

    @Column(nullable = false)
    val name: String,

...

@document(collection = "plan")
@KotlinBuilder
data class MongoPlan(

    val uuid: String? = null,

    val name: String,

....

and mapping instructions

@Mapper
interface MongoPlanMapper {

@Mappings(Mapping(target = "uuid",
        qualifiedByName = ["uuidMapper"]))
fun convert(plan: Plan): MongoPlan

@Named("uuidMapper")
fun uuidMapper(uuid: UUID): String =
        uuid.toString()

}

and I get

Error: java:".

@Pozo
Copy link
Owner

Pozo commented Jul 25, 2020

@AlehGalo Thank you for the report, first please make sure that the issue you mentioned is not only related to mapstruct. If you have time could you please provide me a very basic project where you can reproduce this issue ?

@Pozo Pozo added the question Further information is requested label Jul 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants