Questions tagged [orika]

Orika is an open-source JavaBean mapping library that recursively copies (among other capabilities) data from one object to another. It can be very useful when developing multi-layered applications.

Orika is a Java library facilitating recursive property mapping of JavaBeans. It is configured with static mapping declarations (ClassMap<SRC, DST>) using a Java fluent API and provides type-safe mapper instances (BoundMapperFacade<SRC, DST>).

Resources

184 questions
19
votes
5 answers

lost one day for a date

On client side, i use dd/MM/yyyy date format. The field use a twitter bootstrap 3 datetime picker (https://eonasdan.github.io/bootstrap-datetimepicker/) I enter via twitter bootstrap 3 datetime picker 24/07/2015 in my json i sent, i see: birthdate:…
robert trudel
  • 3,798
  • 12
  • 51
  • 90
15
votes
3 answers

Java POJO attributes mapping

I have a use case where I receive some attributes in the request like this, "filters": [ { "field": "fName", "value": "Tom" }, { "field": "LName", "value": "Hanks" } ] I don't have a model defined for this. I just receive…
User0911
  • 1,438
  • 2
  • 17
  • 30
12
votes
3 answers

Orika - list to list conversion

This is probably an easy one, but I cant find it in the docs. I have a person class class BasicPerson { private String name; private int age; private Date birthDate; // getters/setters omitted } and a list of it ArrayList I…
Bick
  • 15,895
  • 44
  • 133
  • 231
11
votes
3 answers

Orika vs JMapper - how it works and a speed difference - why?

I have downloaded and testing these two mapping libraries. I wrote a program which has 100000 iterations and maps the beans of the same class: public class IntBean { @JMap private int int1; @JMap private int int2; . . . …
user1308908
10
votes
2 answers

How to map java.time.LocalDate field with Orika?

This occurs because LocalDate is not a JavaBean (it has no zero-arg constructor) To fix this, you need to create a LocalDateConverter : public class LocalDateConverter extends BidirectionalConverter { @Override public…
Tristan
  • 7,774
  • 6
  • 41
  • 77
10
votes
1 answer

Orika - mapping object to list (one to many mapping)

I have following two classes class A { class InnerA { private String field; // getters/setters } private Collection collection; // getters/setters } class B { private String field; //…
lbednaszynski
  • 638
  • 2
  • 11
  • 22
9
votes
1 answer

Orika Mapper - Cannot register converters after MapperFacade has been initialized

I have created a class to copy bean properties using Orika Mapper API in spring boot application as shown below: public class ObjectMapper { private static MapperFactory mapperFactory = new DefaultMapperFactory.Builder().build(); public…
JavaDeveloper
  • 517
  • 2
  • 6
  • 15
7
votes
1 answer

Orika ClassCastException in Spring Boot webapp

I'm having a weird ClassCastException while mapping an entity to a DTO with Orika in a sample Spring Boot webapp I'm working on. I get the exception when I attempt to do the mapping on the deployed app in embedded Tomcat, but I can do the mapping…
David Lizárraga
  • 1,092
  • 9
  • 17
7
votes
2 answers

How to configure Orika to map a class to another depending on a context?

I am trying to migrate a project that use dozer to orika. In dozer, it's a common practice to have something like that :
fluminis
  • 3,195
  • 3
  • 25
  • 42
6
votes
1 answer

Orika no mapping of null elements in list

I have the following class: public class A{ List aaList; public A(List aaList){ this.aaList = aaList; } //getters and setters + default constructor public class AA { String aaString; public…
user1345883
  • 441
  • 1
  • 8
  • 20
6
votes
2 answers

Is it actually possible to use generics when defining mappings in Orika?

I know about that type erasure and would prevent to use generics when defining mappings, as this question points out how to map generics objects with Orika?. But Orika FAQ, on the Are generics supported section, claims: Yes. Orika includes special…
David Fernandez
  • 506
  • 5
  • 14
6
votes
1 answer

Mapping between two objects that contain a List using Orika

I am trying to use Orika to map between two objects that contain a List<...> where the List type is another object, however despite trying various permutations of the mapping configuration in mapperFactory.classMap(...) Orika throws an exception…
Paul H
  • 1,964
  • 6
  • 37
  • 49
6
votes
2 answers

How to configure Orika classMap for class hierarchies?

I'm trying to understand how to configure Orika class mapping correctly in case I have inheriting classes. I've set up a simple example to ba able to understand what is working and what is not working, but I do not get it. public class Source { …
jose
  • 121
  • 1
  • 6
5
votes
0 answers

Orika mapper exception

I use Orika mapper for mapping Hibernate entities to webservice entities. It works perfect, but it sometimes throws the following exception. I don't know how to resolve it. I use tomcat. ma.glasnost.orika.MappingException:…
misco
  • 1,885
  • 4
  • 37
  • 66
4
votes
1 answer

Upgrade to Java 8 causes Orika mapper in unittest java.io.IOException: invalid constant type: 15 at 142

I have a project that I want to update the version from Java 1.7 to Java 1.8 but running the UnitTests all mapper tests are failing. The project is using: SpringJUnit4ClassRunner ma.glasnost.orika
m.weiloa
  • 145
  • 9
1
2 3
12 13