mapstruct-examples
mapstruct-examples copied to clipboard
Examples for using MapStruct
When using Apache Spark with Java there is a pretty common use case of converting Spark's Dataframes to POJO-based Datasets. The thing is that many times your Dataframe is imported...
The mapper we added in https://github.com/mapstruct/mapstruct-examples/commit/37dd4c26a84e31dba3f3213fb434e7c14af1c49c should be improved to not need the `@AfterMapping`. This can be fixed once https://github.com/mapstruct/mapstruct/issues/2624 is fixed
Hi, Would be nice to have an example that shows the usage of MapStruct with array (like int[] ) to immutable list with specific add and addAll (like in protobuf)....
I built example project Kotlin Gradle but it showed error "class not found exception" ``` Exception in thread "main" java.lang.RuntimeException: java.lang.ClassNotFoundException: Cannot find implementation for org.mapstruct.example.kotlin.converter.PersonConverter at org.mapstruct.factory.Mappers.getMapper(Mappers.java:61) at org.mapstruct.example.kotlin.MainKt.main(Main.kt:10)...
I have an issue to setup Mapstruct on eclipse (Version: 2021-03 (4.19.0), Build id: 20210312-0638) with following gradle setting: **implementation "org.mapstruct:mapstruct:$mapstructVersion" annotationProcessor "org.mapstruct:mapstruct-processor:$mapstructVersion" annotationProcessor "org.projectlombok:lombok-mapstruct-binding:0.2.0" annotationProcessor "org.projectlombok:lombok" annotationProcessor "org.springframework.boot:spring-boot-configuration-processor"** It...
I love this mapstruct. I am using the 1.4.0.beta version . So , checkstyle is failing in autogenerated mapper impl ` ` Description: When mapstruct is generating the source code,...
I tried converting the mapstruct-quarkus example directly to gradle. https://github.com/danelowe/mapstruct-quarkus-gradle Running `./gradlew quarkusDev` results in an error when trying to access the server (http://localhost:8080/) ``` Caused by: javax.enterprise.inject.UnsatisfiedResolutionException: Unsatisfied dependency...
in testMapObjectToObject add: carDto.setSetCount(7); and Assert.assertEquals(5, carDto.getSeatCount()); test will fail Also, despite the annotation @Mapper(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE) on CarMapper: in testMapObjectToObject change Car car = new Car("Morris", 5, CarType.SPORTS); to...
Can you suggest if there is way in mapstruct to map proto to proto using the mappers
It would be nice to have an example that shows how to use SolrDocument with Mapstruct. I was trying to use MapStruct with SolrDocument and couldn't find a comprehensive example...