 <p>I had almost similar type of requirement in our project. We ended up using the reflection + annotation for mapping. On a nutshell, we were having something like this to construct the object.</p> <pre><code>class Job { String title; @ManyToOne @JoinColumn(name = "location_id") @EntityMapper(isRef="true")//Custom Annotation JobLocation location; } class JobLocation { @EntityMapper(fieldName="jobLocationId") int id; @EntityMapper(fieldName="jobLocationDescription")//Custom Annotation String description; double latitude; double longitude; } </code></pre> <p>If you haven't got what I mean, we created custom annotation and we wrote a utility method that via reflection loops through the elements that has annotations as follows:</p> <pre><code>for (Field field : object.getClass().getDeclaredFields()) { //check for the EntityMapper annotation if (field.getAnnotation(EntityMapper.class) != null) { . . .//Use more reflection to use getters and setters to create and assign values from the JSON request. } } </code></pre>