Mohamed Saligh
Mohamed Saligh

Reputation: 12349

easy way to make many pojo into one pojo

Am having a registration form which has multiple pages. So, I am mapping one page to one pojo. Finally, when I processing with database, I want to make it as single pojo to commit. Any idea to simplify this model.

Thanks :)

Upvotes: 3

Views: 548

Answers (2)

jzd
jzd

Reputation: 23629

What is wrong with sending multiple POJOs to your service level to commit to the database. Koekiebox's suggestion of a wrapper POJO will work, but also will add another place to make changes to if you add or remove POJOs.

If the data truly belongs together why not increase the number of fields in your POJO and use just one for your form and database.

Upvotes: 0

Koekiebox
Koekiebox

Reputation: 5963

You can create a wrapper POJO which holds your other POJO's with additional helper methods in the master POJO.

Upvotes: 5

Related Questions