Ravi Srinivasan
2018-09-10 aaf094af7ecf98e07e31a231fdab871b25961bd1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package com.redhat.training.ui;
 
import javax.enterprise.context.RequestScoped;
import javax.inject.Named;
 
import com.redhat.training.model.Person;
import com.redhat.training.services.PersonService;
 
import javax.inject.Inject;
import java.util.List;
 
 
 
@RequestScoped
@Named("hello")
public class Hello {
    private String name;
    private Long id;
    private List<Person> results;
 
    @Inject
    private PersonService personService;
 
    public String getName() {
        return name;
    }
 
    public void setName(String name) {
        this.name = name;
    }
 
    public Long getId() {
        return id;
    }
 
    public void setId(Long id) {
        this.id = id;
    }
 
        //View all persons in the database table
      public List<Person> getPersons() {
                return personService.getAllPersons();
        }
 
    //view all persons whose name matches the name given in the query
    public void search() {
            results = personService.getPersonsWithName(name);
    }
 
        public List<Person> getResults() {
                return results;
        }
 
        public void setResults(List<Person> results) {
                this.results = results;
        }
 
 
}