IntelliJ IDEA Ultimate: DTO Tricks
Whenever I have some extra time on hand or a very tedious story coming up, it is my favourite time pass to explore things to automate my workflow.
I have got some new tricks that might be helpful and be able to take your productivity to the next level.
DTO generator plugin
The first one is a great plugin from N Vinay Shetty called DTO generator. This generator helps you create a DTO class from JSON data. For example, you have a sample response from a 3rd Party API, all you have to do to create a DTO is go to the DTO generator and paste your sample response and voila!
JPA Buddy DTO Generation
If you use JPA Hibernate in your application, this will come in very handy. It is very common to use the entity class to create the object directly at the place of generation of data, but sometimes that is not suitable. In such cases we need a DTO to transform the data into persistable form. Here, JPA Buddy comes in clutch where you can create a DTO directly from the entity and edit it the way you want. This is especially useful when you need DTOs for multiple entities. Within a couple of clicks you’ll have all the DTOs ready.
I’ll be updating this list as and when I get new content. So, keep an eye out for it.