I'm searching for a way to convert just a partial object (not all attrbiutes of it) via jackson to json. At the moment I'm using this solution:
User userServed = User.find.byId(id);
ObjectMapper mapper = new ObjectMapper();
JsonNode node = null;
node = mapper.convertValue(userServed, JsonNode.class);
It works fine so far.
My Problem is that I have a lot of attributes in the Object I don't want to expose to the json node like lists. Is there a way maybe to select just the needed attributes?