Shorter way to copy the output result set into the Java beans
Define factory class object
//filled result set java.sql.ResultSet
resultSet;
UnmarshallerFactory factory = new UnmarshallerFactory();
ModelType mType=factory.getModelType(resultSet);
if result will be a single row then instantiate the Model class
Model model=mtype.getModel();
String jsonString=model.getJsonString(); //getting json data from model object
or if result may have multiple rows then instantiate the ListModel class
ListModel listModel=mtype.getListModel();
String jsonString=listModel.getJsonString(); //getting json data from listmodel object
Now you have the constructed result and as well as json string
YourDomain yd=(YourDomain) model.populateModel(YourDomain.class);
//or
List listObj=listModel.populateListModel(YourDomain.class);