From version 2.1
edited by Vladyslav Pavlov
on 2018/03/25 17:53
To version 3.1
edited by Denis Pavlov
on 2018/03/26 12:59
Change comment: There is no comment for this version

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -xwiki:XWiki.vpavlov
1 +xwiki:XWiki.dpavlov
Content
... ... @@ -20,7 +20,6 @@
20 20  
21 21  (((
22 22  {{code language="java"}}
23 -
24 24  final ExtensibleBeanFactory bf = ...
25 25  final Registry registry = new DefaultDSLRegistry(bf);
26 26  
... ... @@ -72,7 +72,6 @@
72 72  
73 73  (((
74 74  {{code language="java"}}
75 -
76 76  ...
77 77  registry
78 78   .dto(MyDtoField3Class.class).forEntity(MyEntityField3Class.class)
... ... @@ -100,7 +100,6 @@
100 100  
101 101  (((
102 102  {{code language="java"}}
103 -
104 104  ...
105 105  registry
106 106   .dto(MyDtoField3Class.class).forEntity(MyEntityField3Class.class)
... ... @@ -119,7 +119,6 @@
119 119  
120 120  (((
121 121  {{code language="java"}}
122 -
123 123  ...
124 124  registry
125 125   .dto(MyDtoField3Class.class).forEntity(MyEntityField3Class.class)
... ... @@ -140,7 +140,6 @@
140 140  
141 141  (((
142 142  {{code language="java"}}
143 -
144 144  ...
145 145  registry1
146 146   .dto(MyDtoField3Class.class).forEntity(MyEntityField3Class.class)
... ... @@ -161,7 +161,6 @@
161 161  
162 162  (((
163 163  {{code language="java"}}
164 -
165 165  registry
166 166   // main mapping
167 167   .dto("myDto").forEntityGeneric()
... ... @@ -172,7 +172,7 @@
172 172  {{/code}}
173 173  )))
174 174  
175 -So the above mapping will apply to any entity that DTOAssembler will be created for. Which is useful when you have multiple implementations or indeed different classes that have same properties.
169 +So the above mapping will apply to any entity that DTOAssembler will be created for. Which is useful when you have multiple implementations or indeed different classes that have same properties.
176 176  Now at this point it seems to be quite verbose - I mean every entity class has to be specified, and you'd be wrong because we can do this:
177 177  
178 178  **Reuse mapping**
... ... @@ -179,7 +179,6 @@
179 179  
180 180  (((
181 181  {{code language="java"}}
182 -
183 183   registry.dto("myDto").useContextFor(
184 184   registry
185 185   // main mapping
... ... @@ -196,7 +196,6 @@
196 196  
197 197  (((
198 198  {{code language="java"}}
199 -
200 200  ...
201 201  final Assembler asm = DTOAssembler
202 202   .newAssembler(MyDtoClass.class, MyEntity.class, registry);
GeDA - Generic DTO Assembler © Denys Pavlov 2009 - 2019
v.1.0.0