2
에 XML 파일을 ArrayList의 데이터를 매핑하고이 두 DTO 클래스에 데이터를 설정 : DetailsDTO
에 Customer
클래스의 데이터를 추가 한 후가 어떻게 요구 사항에 따라, 내가 분석 한 DTO
public class DetailsDTO implements java.io.Serializable {
private String userid;
private String accountnum;
private Customer customer;
// setters and getters
public class Customer implements Serializable
{
private String street;
private String country;
// setters and getters
, 나는 추가 이 DetailsDTO
그림과 같이 ArrayList
에 :
List list = new ArrayList();
// and added these DetailsDTO class to an ArrayList
list.add(detailsDTO)
지금과 같이 다양한 DTO 클래스에 정의 된 모든 변수를 구성 WholeDetails
로 불리는 마스터 DTO있다. 당신이 보는대로
class WholeDetails
{
private String userid;
private String accountnum;
private String street;
private String country;
}
지금, 모든 데이터는 ArrayList
내 aviable이다.
ArrayList
에서 콘텐츠를 추출하고 WholeDetails
에 매핑하려면 어떻게해야합니까?
당신에게 대단히 감사 목록에 결과 개체를 추가 할 수 있습니다 더 짧게 싶은 경우에, 당신은 저장 내 불면의 밤. – Revathi