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.
29 lines
553 B
29 lines
553 B
package com.codenotfound.primefaces;
|
|
|
|
import java.io.Serializable;
|
|
import java.util.List;
|
|
import javax.annotation.PostConstruct;
|
|
import javax.faces.view.ViewScoped;
|
|
import javax.inject.Inject;
|
|
import javax.inject.Named;
|
|
|
|
@Named
|
|
@ViewScoped
|
|
public class CarsView implements Serializable {
|
|
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
@Inject
|
|
private CarRepository carRepository;
|
|
|
|
private List<Car> cars;
|
|
|
|
@PostConstruct
|
|
public void init() {
|
|
cars = carRepository.findAll();
|
|
}
|
|
|
|
public List<Car> getCars() {
|
|
return cars;
|
|
}
|
|
}
|
|
|