We have a simple data model that reflects the following ...
- User contains many @OneToMany addresses
- The user contains many @OneToMany phones.
- User contains many emails @OneToMany
- User owned by @Organization via @ManyToOne
We would like our clients to record all the user information on the excel / csv sheet and provide it to our download tool. We provide a simple user interface for capturing the order of fields for import. We did not encounter any problems when we supported import only for the user (i.e. we allow the end user to determine the order of the imported fields and use it in excel)
We are not sure which strategy would be the right one to support @OneToMany and @ManyToOne fields. The problems are as follows.
- Not sure how to smooth out the information if the user has several addresses in a flat line (for example, User1 has 2 addresses, 1 phone, 3 letters and user 2 has 1 address, 1 phone ...)
- How to handle @ManyToOne annotations (you cannot expect the end user to provide a primary key - Integer identifier in this case), you expect them to provide the organization name here, if imported after publication, the user can change this information if necessary
- How to handle delta values during an import operation (say 10 additional users?)
- Do you have one import file for the organization, users, UserAdress and all dependent objects?
- /API, , ?