2018-09-04 11:36:18 +02:00
|
|
|
package eu.eudat.logic.managers;
|
|
|
|
|
|
|
|
import eu.eudat.data.entities.DataRepository;
|
|
|
|
import eu.eudat.data.entities.Registry;
|
|
|
|
import eu.eudat.logic.services.ApiContext;
|
|
|
|
import eu.eudat.models.data.datarepository.DataRepositoryModel;
|
|
|
|
import eu.eudat.models.data.registries.RegistryModel;
|
2019-02-01 17:56:55 +01:00
|
|
|
import org.springframework.stereotype.Component;
|
2018-09-04 11:36:18 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Created by ikalyvas on 9/3/2018.
|
|
|
|
*/
|
2019-02-01 17:56:55 +01:00
|
|
|
@Component
|
2018-09-04 11:36:18 +02:00
|
|
|
public class RegistryManager {
|
2019-02-01 17:56:55 +01:00
|
|
|
public Registry create(ApiContext apiContext, RegistryModel registryModel) throws Exception {
|
2018-09-04 11:36:18 +02:00
|
|
|
Registry registry = registryModel.toDataModel();
|
|
|
|
return apiContext.getOperationsContext().getDatabaseRepository().getRegistryDao().createOrUpdate(registry);
|
|
|
|
}
|
|
|
|
}
|