01: package jspPhoneBook.business;
02:
03: import jspPhoneBook.data.PersonDO;
04:
05: /**
06: * Person defines the business level methods available to modify
07: * a person. This object would enforce any business logic....
08: * it isn't really used by this demo.
09: */
10: public class Person {
11:
12: private PersonDO p;
13:
14: protected Person(PersonDO p) {
15: this .p = p;
16: }
17:
18: public String getFirstName() {
19: try {
20: return p.getFirstName();
21: } catch (Exception e) {
22: System.out.println(e);
23: return "";
24: }
25: }
26:
27: public String getLastName() {
28: try {
29: return p.getLastName();
30: } catch (Exception e) {
31: System.out.println(e);
32: return "";
33: }
34: }
35:
36: public String getPhoneNumber() {
37: try {
38: return p.getPhoneNumber();
39: } catch (Exception e) {
40: System.out.println(e);
41: return "";
42: }
43: }
44:
45: public String getId() throws Exception {
46: try {
47: return "" + p.getOId();
48: } catch (Exception e) {
49: System.out.println(e);
50: return "";
51: }
52: }
53:
54: }
|