Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Object contains list of objects inside #41

Closed
surimogili opened this issue Jul 31, 2018 · 5 comments
Closed

Object contains list of objects inside #41

surimogili opened this issue Jul 31, 2018 · 5 comments

Comments

@surimogili
Copy link

For example if I want to read excel where I have objects inside one object
Like
Inside Employee
I have Address object with different fields
or for example if I have two address for one employee
In this case how we can handle this?
My model looks like this
Employee
{
List

addressList;
}

Address
{
String pincode;
}

Can you pls help how todo using poiji

@ozlerhakan
Copy link
Owner

Hi @surimogili ,

Does each address exist in a different column?

Name Adress 1 Address 2
Joe address1 address2
Paul address1 $address2

@surimogili
Copy link
Author

Yes, exactly. Not only address, we have more such repetitive columns.

@ozlerhakan
Copy link
Owner

ozlerhakan commented Aug 1, 2018

If your excel columns are fixed, you can create an entity class like below:

public class Person {

    @ExcelCell(0)
    private String name;

    @ExcelCell(1)
    private String address1;

    @ExcelCell(2)
    private String address2;

}

If the columns are not fixed,

public class Person {

    @ExcelCellName("Name")
    private String name;

    @ExcelCellName("Address 1")
    private String address1;

    @ExcelCellName("Address 2")
    private String address2;

}

@surimogili
Copy link
Author

No, what I want exactly is
Inside Person, I have list of address objects. For example below are the column names
Name, address1, city1, state1, pincode1, address2, city2, state2, pincode2;

My Model class will look like this
Person
{
String name;
List

addressList;
}

In address class I should have like this

Address
{
String address;
String city;
String state;
String pincode;
}

@ozlerhakan
Copy link
Owner

poiji doesn't support such approach @surimogili

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants