Created
April 14, 2020 11:23
-
-
Save sonOfRa/bb0e8f3f7d31d365f1bf33ccc49b32c4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package de.slevermann.cocktails.services; | |
import de.slevermann.cocktails.daos.IngredientDao; | |
import de.slevermann.cocktails.models.Ingredient; | |
import org.springframework.stereotype.Service; | |
import org.springframework.transaction.annotation.Transactional; | |
import org.springframework.validation.annotation.Validated; | |
import javax.validation.Valid; | |
@Service | |
@Transactional | |
@Validated | |
public class IngredientService { | |
private IngredientDao ingredientDao; | |
public IngredientService(IngredientDao ingredientDao) { | |
this.ingredientDao = ingredientDao; | |
} | |
public Long createIngredient(@Valid Ingredient ingredient) { | |
return ingredientDao.insert(ingredient); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment