easy way to make many pojo into one pojo
Am having a registration form which has multiple pages. So, I am mapping one 开发者_如何学JAVApage 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 :)
You can create a wrapper POJO which holds your other POJO's with additional helper methods in the master POJO.
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.
精彩评论