de.frachtwerk.essencium.backend.controller.DefaultRestController Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of essencium-backend-sequence-model Show documentation
Show all versions of essencium-backend-sequence-model Show documentation
Essencium-backend-sequence-model is a software library built on top of Essencium Backend that allows
developers to quickly get started on new software projects. Essencium provides, for example, a fully implemented
role-rights concept as well as various field-tested solutions for access management and authentication.
Essencium Backend Sequence Model uses Numbers following Hibernates SequenceId-Strategy as primary keys in
relational databases and delivers a fully implemented App-User.
/*
* Copyright (C) 2024 Frachtwerk GmbH, Leopoldstraße 7C, 76133 Karlsruhe.
*
* This file is part of essencium-backend.
*
* essencium-backend is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* essencium-backend is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with essencium-backend. If not, see .
*/
package de.frachtwerk.essencium.backend.controller;
import de.frachtwerk.essencium.backend.model.Identifiable;
import de.frachtwerk.essencium.backend.model.SequenceIdModel;
import de.frachtwerk.essencium.backend.service.DefaultAssemblingEntityService;
import org.springframework.data.domain.Page;
import org.springframework.data.jpa.domain.Specification;
public class DefaultRestController<
M extends SequenceIdModel, IN extends Identifiable, OUT, S extends Specification>
extends AbstractAccessAwareController {
private final DefaultAssemblingEntityService abstractAssemblingEntityService;
public DefaultRestController(DefaultAssemblingEntityService service) {
super(service);
this.abstractAssemblingEntityService = service;
}
@Override
public OUT toRepresentation(M entity) {
return abstractAssemblingEntityService.toOutput(entity);
}
@Override
public Page toRepresentation(Page page) {
return abstractAssemblingEntityService.toOutput(page);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy