de.terrestris.shoguncore.rest.TreeNodeRestController Maven / Gradle / Ivy
package de.terrestris.shoguncore.rest;
import de.terrestris.shoguncore.dao.TreeNodeDao;
import de.terrestris.shoguncore.model.tree.TreeNode;
import de.terrestris.shoguncore.service.TreeNodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @author Kai Volland
* @author Nils Bühner
*/
@RestController
@RequestMapping("/treenodes")
public class TreeNodeRestController, S extends TreeNodeService>
extends AbstractRestController {
/**
* Default constructor, which calls the type-constructor
*/
@SuppressWarnings("unchecked")
public TreeNodeRestController() {
this((Class) TreeNode.class);
}
/**
* Constructor that sets the concrete entity class for the controller.
* Subclasses MUST call this constructor.
*/
protected TreeNodeRestController(Class entityClass) {
super(entityClass);
}
/**
* We have to use {@link Qualifier} to define the correct service here.
* Otherwise, spring can not decide which service has to be autowired here
* as there are multiple candidates.
*/
@Override
@Autowired
@Qualifier("treeNodeService")
public void setService(S service) {
this.service = service;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy