Questions tagged [object-object-mapping]
129 questions
372
votes
9 answers
Ignore mapping one property with Automapper
I'm using Automapper and I have the following scenario:
Class OrderModel has a property called 'ProductName' that isn't in the database.
So when I try to do the mapping with:
Mapper.CreateMap();
It generates an exception :
"The…

Msam85
- 3,964
- 2
- 18
- 18
208
votes
4 answers
AutoMapper vs ValueInjecter
Everytime I'm looking for AutoMapper stuff on StackOverflow, I'm reading something about ValueInjecter.
Can somebody tell me the pros and cons between them (performance, features, API usage, extensibility, testing) ?

Rookian
- 19,841
- 28
- 110
- 180
113
votes
12 answers
Configuring ObjectMapper in Spring
My goal is to configure the objectMapper in the way that it only serialises element which are annotated with @JsonProperty.
In order to do so I followed this explanation which says how to configurate the objectmapper.
I included the custom…

Steve Eastwood
- 1,783
- 3
- 16
- 21
14
votes
4 answers
Domain Driven Design, .NET and the Entity Framework
I'm new to domain driven design but want to learn it and use it for a new application.
I will be using Entity Framework for data access.
The basic layout so far is:
ASP.NET MVC and other clients (mobile
devices etc.)
|
Webservices
|
…

Christian V
- 2,010
- 17
- 26
13
votes
1 answer
Dozer: How to limit the depth of mappings?
I'm currently using Dozer for mapping Entity objects to Dto objects in my project.
My question is how to limit the levels or the depth of internal mappings?
For example I have a AccountProfile entity which has a List entity as…

STaefi
- 4,297
- 1
- 25
- 43
12
votes
2 answers
Can't map property when using MapStruct
I am using MapStruct library to map objects but I got this error:
Can't map property "java.util.Date aDate" to "javax.xml.bind.JAXBElement ADATE". Consider to declare/implement a mapping method: "javax.xml.bind.JAXBElement map(java.util.Date…

zygimantus
- 3,649
- 4
- 39
- 54
11
votes
2 answers
What are the different approaches to Object-Object mapping in .NET?
I'm needing to do some mapping between objects (e.g. PersonModel to PersonViewModel) and am researching on the different approaches to do this. Specifically I'm working with Entity Framework and trying to map the generated models to a…

bloodfire1004
- 493
- 2
- 8
- 24
11
votes
2 answers
MapStruct: Mapping 2 objects to a 3rd one
I have Object1 and Object2. Now, I want to map object3, with attributes from 1 & 2.
Say, I have 2 object:
1. User: {first_name, last_name, id}
2. Address: {street, locality, city, state, pin, id}
Now, with these, I want to map that in
User_View:…

anij
- 1,322
- 5
- 23
- 39
10
votes
3 answers
What are the advantages of using automapper?
I have to do some object to object mapping between domain classes used in a C# project and classes which are sent to flash clients.
My first choice was Automapper. But I've had some issues with it (nested properties, no parameterless constructor…

Katalonis
- 691
- 2
- 6
- 16
8
votes
3 answers
ModelMapper: mapping abstract classes during runtime
I am using ModelMapper Framework (http://modelmapper.org/) for mapping objects in Java.
I have encountered a problem while mapping concrete classes (DTO to Entites) containing abstract classes.
Example:
Task has a list of AbstractItems.…

kk-dev11
- 2,654
- 5
- 37
- 48
7
votes
2 answers
MapStruct: Map multiple sources from multiple objects to one target
I want to map the following classes
class Schedule {
ZoneId timezoneId;
List rules;
}
class AvailabilityRule {
long startEpoch;
long endEpoch;
}
to these classes.
class ScheduleDTO {
String timezone;
…

duplex143
- 619
- 2
- 9
- 25
7
votes
2 answers
Is there a suggested pattern for using LINQ between the Model & DataAccess Layers in a DDD based Layered Architecture
I've been reading Tim McCarthy's awesome book on DDD in .NET. In his example application though, his underlying data access is using SqlCE and he's handcrafting the SQL inline.
I've been playing with some patterns for leveraging Entity Framework but…

Eoin Campbell
- 43,500
- 17
- 101
- 157
7
votes
4 answers
difference between system design and object oriented design
can someone please explain the difference between system design and object oriented design?
Object oriented design involves object modeling and uses object oriented concepts such as Abstraction, Encapsulation, Decomposition and Generalization. Both…

Prashant Bhanarkar
- 930
- 3
- 14
- 32
7
votes
2 answers
Jackson - Wrapping a list of objects with root object
My Controller returns a list of MyObj objects (using @ResponseBody)
public MyObj
{
int a;
int b;
}
The return JSON looks like this:
[{"a":1,"b":2},{"a":2,"b":2}]
I would like to wrap this JSON so it will return something like:
{ "data":…

user1782427
- 770
- 1
- 8
- 19
6
votes
3 answers
Map Nested elements - Mapstruct
I'm trying to map following source classes to target class using MapStruct.
Target Classes :
public class Response {
private List customer = new ArrayList();
}
public class Customer {
private String customerId;
…

Futuregeek
- 1,900
- 3
- 26
- 51