You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
803 B
35 lines
803 B
package com.mousetech.gourmetj;
|
|
|
|
import java.io.Serializable;
|
|
import java.util.List;
|
|
import javax.enterprise.context.ApplicationScoped;
|
|
import javax.inject.Inject;
|
|
import javax.inject.Named;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
import com.mousetech.gourmetj.persistence.model.Category;
|
|
|
|
@Named
|
|
@ApplicationScoped
|
|
@Transactional
|
|
public class CategoryService implements Serializable {
|
|
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
@Inject
|
|
private CategoryRepository categoryRepository;
|
|
|
|
|
|
public List<Category> findAll() {
|
|
return categoryRepository.findAll();
|
|
}
|
|
|
|
/**
|
|
*
|
|
* @return All Category names that are not null/blank, sorted.
|
|
*/
|
|
public List<String> findCategoryNames() {
|
|
return categoryRepository.findDistinctCategoryNative();
|
|
}
|
|
}
|
|
|