Note that there are some explanatory texts on larger screens.

plurals
  1. PODozer Set to List mapping only common fields
    text
    copied!<p>Dozer mapping: </p> <pre><code>&lt;mapping&gt; &lt;class-a&gt;com.foo.common.data.transfer.objects.WidgetDTO&lt;/class-a&gt; &lt;class-b&gt;com.foo.dashboard.pojo.Widget&lt;/class-b&gt; &lt;field&gt; &lt;a&gt;id&lt;/a&gt; &lt;b&gt;widgetId&lt;/b&gt; &lt;/field&gt; &lt;field&gt; &lt;a&gt;name&lt;/a&gt; &lt;b&gt;name&lt;/b&gt; &lt;/field&gt; &lt;field&gt; &lt;a&gt;widgetAttributeSet&lt;/a&gt; &lt;b&gt;attributesList&lt;/b&gt; &lt;/field&gt; &lt;/mapping&gt; </code></pre> <p>When Dozer converts my DTO to my POJO it copies every field in my DTO to my POJO. My POJO only has two fields (name and value). Is there a way to prevent Dozer from copying fields that do not exist in my POJO? What I mean by copying every field from my DTO to POJO is when I debug my code it shows the converted list of attributes as</p> <p>Attribute POJO in List Fields:</p> <pre><code>private static final long serialVersionUID = 1L; private UUID id; private String name; private String value; private WidgetDTO fkWidgetId; </code></pre> <p>The returned list that Dozer returns should only have these fields in an Attribute POJO element:</p> <pre><code>private String name; private String value; </code></pre> <p>WidgetAttribute DTO Fields:</p> <pre><code>private static final long serialVersionUID = 1L; private UUID id; private String name; private String value; private WidgetDTO fkWidgetId; </code></pre> <p>Attribute POJO Fields:</p> <pre><code>private String name; private String value; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload