请帮我删除下面不需要的额外线条。
当前输出:
001 Name1Str1 CA 1234
001 Name2Str2 IN 4321
005 30Manager Technology
005 50Lead Technology
Java代码:
ArrayList<Employees1> emps = new ArrayList<>();
ArrayList<Employee1> empp1 = new ArrayList<>();
ArrayList<Employee2> empp2 = new ArrayList<>();
Employees1 employees = new Employees1();
Employee1 emp1 = new Employee1();
emp1.setSno("001");
emp1.setName("Name1");
emp1.setStreet("Str1");
emp1.setCity("CA");
emp1.setZip("1234");
empp1.add(emp1);
Employee2 emp2 = new Employee2();
emp2.setSno("005");
emp2.setAge("30");
emp2.setPosition("Manager Technology");
empp2.add(emp2);
Employee1 emp12 = new Employee1();
emp12.setSno("001");
emp12.setName("Name2");
emp12.setStreet("Str2");
emp12.setCity("IN");
emp12.setZip("4321");
empp1.add(emp12);
Employee2 emp22 = new Employee2();
emp22.setSno("005");
emp22.setAge("50");
emp22.setPosition("Lead Technology");
empp2.add(emp22);
employees.setEmployee1(empp1);
employees.setEmployee2(empp2);
emps.add(employees);
mapping.xml
<stream name="employeeStream" format="fixedlength">
<group name="employees" class="com.Employees1">
<record name="employee1" class="com.Employee1" minOccurs="0"
maxOccurs="unbounded" collection="list">
<field name="sno" length="5" rid="true" literal="001" />
<field name="name" length="5" />
<field name="street" length="5" />
<field name="city" length="5" />
<field name="zip" length="5" />
</record>
<record name="employee2" class="com.Employee2" minOccurs="0"
maxOccurs="unbounded" collection="list">
<field name="sno" length="5" rid="true" literal="005" />
<field name="age" length="2" />
<field name="position" length="18" />
</record>
</group>
</stream>
JavaCode:
public class Employee1 {
private String sno;
private String name;
private String street;
private String city;
private String zip;
}
public class Employee2 {
private String sno;
private String age;
private String position;
}
public class Employees1 implements Serializable
{
private List<Employee1> employee1 = null;
private List<Employee2> employee2 = null;
}