Home > database >  file from one node to another node?
file from one node to another node?

Time:04-25

I would like to add a database to it so that the information is stored.

CodePudding user response:

You need to map Dto objects with Entities. Use Mapstruct for the purpose. Next configure any Data base in your project and make connection to it. For ease it could be H2 data base. It's better to write set of CRUD REST controllers that will get all needed information from a site accordingly it's api specification and save it to DB. Then in main Spring Boot application class you code some logic applying to the REST controllers.

CodePudding user response:

You can use the ModelMapper class to convert Dto to Model and vice versa. ModelMapper class has map() which maps Model to Dto and vice versa. Once you convert the Dto to Model you can call currencyRepository.save() to save the Model to the database.

You can refer this link.

  • Related