DatabaseTableMapping personMapping = JdbcConnectionHandler.instance().getDatabaseTableMapping(PersonModel.class.getName());
DatabaseTableMapping addressMapping = JdbcConnectionHandler.instance().getDatabaseTableMapping(AddressModel.class.getName());
DatabaseTableMapping phoneMapping = JdbcConnectionHandler.instance().getDatabaseTableMapping(PhoneModel.class.getName());
try {
mapping.search(null, new MemberModel(), members);
DataModelEnumeration en = members.getEnumeration();
while (en.hasMore()) {
MemberModel member = (MemberModel) en.next();
PersonModel person = member.getPerson();
person.setInstanceName(member.getPersonId());
personMapping.read(person);
addressMapping.readChildren(member.getAddresses());
phoneMapping.readChildren(member.getPhones());
}
} catch (Exception e) {
e.printStackTrace(); //TODO
}