Questions tagged [dozer]

Dozer is a Java Bean to Java Bean mapper that recursively copies data from one object to another. Typically, these Java Beans will be of different complex types.

From the Dozer website:

Dozer is a Java Bean to Java Bean mapper that recursively copies data from one object to another. Typically, these Java Beans will be of different complex types.

Dozer supports simple property mapping, complex type mapping, bi-directional mapping, implicit-explicit mapping, as well as recursive mapping. This includes mapping collection attributes that also need mapping at the element level.

Dozer not only supports mapping between attribute names, but also automatically converting between types. Most conversion scenarios are supported out of the box, but Dozer also allows you to specify custom conversions via XML.

530 questions
4
votes
2 answers

Dozer file not found exception

I am trying to execute below dozer example. my xml file is located in the same location as my java file, but i am getting the file not found exception Exception in thread "main" org.dozer.MappingException: Unable to locate dozer mapping file…
Rafi
  • 161
  • 3
  • 5
  • 7
4
votes
2 answers

Dozer Deep Mapping with Annotations

Unable to map deep mapping from Source class to Target class SourceEmployee.Address.houseName to TargetEmployee.houseName Source object class public class SourceEmployee { private String empName; private Address addr; enter code…
Rafi
  • 161
  • 3
  • 5
  • 7
4
votes
6 answers

Custom converter with Spring dependency injection

Is there a way to define a custom converter in Dozer for converting one top-level type to another, which is itself a Spring bean and thus can get its dependencies injected? The dozer docs propose to add the following XML definition:
Thilo-Alexander Ginkel
  • 6,898
  • 10
  • 45
  • 58
4
votes
1 answer

How to turn off Dozer logging entries in log4j2?

How to turn off Dozer logging entries in log4j2 ? Using Java 1.8, Dozer version: 6.4.1, Logger version 2.11.2 on Windows 7 pom.xml config : com.github.dozermapper dozer-core Every time I load a web…
techStack
  • 103
  • 6
4
votes
1 answer

Dozer - Excluding nested Objects

According to this example you can do Deep Mapping with Dozer : http://dozer.sourceforge.net/documentation/deepmapping.html com.github.dozermapper.core.vo.deep.SrcDeepObj
techStack
  • 103
  • 6
4
votes
0 answers

Dozer mapping of generic lists

I have a ListWrapper like public class ListWrapper { private List entries = new ArrayList(); public List getEntries() { return entries; } public void setEntries(List entries) { this.entries = entries; } and a bean like…
ABX
  • 1,173
  • 2
  • 22
  • 39
4
votes
3 answers

DTO mapping and updating to a Database with Java, Dozer and Hibernate

I'm using Dozer to map Hibernate entities to their DTOs. A simplified example class is the following: @Entity public class Role { @Id @GeneratedValue @Column(name="RoleId", nullable=false) public int roleId; …
Endo
  • 363
  • 1
  • 6
  • 20
4
votes
3 answers

Dozer bidirectional mapping (String, String) with custom comverter impossible?

I have a Dozer mapping with a custom converter: com.xyz.Customer com.xyz.CustomerDAO customerName
ABX
  • 1,173
  • 2
  • 22
  • 39
4
votes
2 answers

Hibernate Persistence problems with Bean Mapping (Dozer)

I am using Hibernate 3, and having a particular issue when persisting a new Entity which has an association with an existing detached entity. Easiest way to explain this is via code samples. I have two entities, FooEntity and BarEntity, of which…
BuffaloBuffalo
  • 7,703
  • 4
  • 28
  • 29
4
votes
2 answers

Dozer MappingException NoSuchMethodException init

I'm in code of a project. I got a error when I try to convert a object RRREC type into RR_REC type. The RRREC class: public class RRREC{ protected String owner; protected RRINFRATYPE infraType; // getter and setter } The RR_REC…
Tam Nguyen
  • 93
  • 1
  • 3
  • 11
4
votes
1 answer

Dozer - create reference of parent object

I'm trying to populate Hibernate entity - "Parent", from JAXB entity "JaxbParent" using Dozer. My Hibernate entity: public class Parent { String name; String age; @OneToMany private Set childSet; } public class Child { …
stinger
  • 3,790
  • 1
  • 19
  • 30
4
votes
0 answers

How to unit test xml based dozer mappings

I have a system where mapping of backend to frontend objects (DTOs) is mainly done by applying Dozer mappings selectively. Those mappings are configured via XML. The code looks like this: scope2hits.get(scope) …
Ronald
  • 111
  • 1
  • 7
4
votes
3 answers

Map a list of object to another list using Dozer's custom converters

What I am trying to do is to map a List of entities to a list of their String ids (more or less) using Dozer. Obviously, it implies Custom Converter. My first idea was to make a converter from MyEntity to a String, and then say to Dozer something…
tanou
  • 1,083
  • 2
  • 13
  • 33
4
votes
0 answers

Dozer Mapper Performance

I've been doing some work within my hadoop job and was able to quickly get Dozer mapping between object hierarchies. I have some complex objects that I need to convert to Thrift types. When I enable this mapping, it adds nearly 5 minutes of…
Galuvian
  • 318
  • 3
  • 11
4
votes
1 answer

How to specify limit or level of recursion of a circular relationship using Dozer

I have two JPA2 entity classes that refer to each other class Person { int id; String name; @ManyToOne(fetch = FetchType.LAZY) Company company; } class Company{ int id; String name; @ManyToOne(fetch = FetchType.LAZY) Person…
jmpeace
  • 179
  • 2
  • 10