This repository was archived by the owner on Nov 26, 2020. It is now read-only.
This repository was archived by the owner on Nov 26, 2020. It is now read-only.
Mapping of UUID to String error #17
Open
Description
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:".