Merge pull request #4 from sasankglowtouch/daniel

Not too sure what I'm doing -Daniel
This commit is contained in:
Austin-Mills 2017-06-19 14:35:00 -04:00 committed by GitHub
commit bc22f85a84
6 changed files with 35 additions and 14 deletions

View file

@ -52,7 +52,11 @@ public class Parent extends Person {
@Column(name = "city")
@NotEmpty
private String city;
@Column(name = "state")
@NotEmpty
private String state;
@Column(name = "telephone")
@NotEmpty
@Digits(fraction = 0, integer = 10)
@ -77,6 +81,14 @@ public class Parent extends Person {
public void setCity(String city) {
this.city = city;
}
public String getState(){
return this.state;
}
public void setState(String state){
this.state = state;
}
public String getTelephone() {
return this.telephone;

View file

@ -19,16 +19,16 @@ INSERT INTO gender VALUES (1, 'Male');
INSERT INTO gender VALUES (2, 'Female');
INSERT INTO parents VALUES (1, 'George', 'Franklin', '110 W. Liberty St.', 'Madison', '6085551023');
INSERT INTO parents VALUES (2, 'Betty', 'Davis', '638 Cardinal Ave.', 'Sun Prairie', '6085551749');
INSERT INTO parents VALUES (3, 'Eduardo', 'Rodriquez', '2693 Commerce St.', 'McFarland', '6085558763');
INSERT INTO parents VALUES (4, 'Harold', 'Davis', '563 Friendly St.', 'Windsor', '6085553198');
INSERT INTO parents VALUES (5, 'Peter', 'McTavish', '2387 S. Fair Way', 'Madison', '6085552765');
INSERT INTO parents VALUES (6, 'Jean', 'Coleman', '105 N. Lake St.', 'Monona', '6085552654');
INSERT INTO parents VALUES (7, 'Jeff', 'Black', '1450 Oak Blvd.', 'Monona', '6085555387');
INSERT INTO parents VALUES (8, 'Maria', 'Escobito', '345 Maple St.', 'Madison', '6085557683');
INSERT INTO parents VALUES (9, 'David', 'Schroeder', '2749 Blackhawk Trail', 'Madison', '6085559435');
INSERT INTO parents VALUES (10, 'Carlos', 'Estaban', '2335 Independence La.', 'Waunakee', '6085555487');
INSERT INTO parents VALUES (1, 'George', 'Franklin', '110 W. Liberty St.', 'Madison', 'WI', '6085551023');
INSERT INTO parents VALUES (2, 'Betty', 'Davis', '638 Cardinal Ave.', 'Sun Prairie', 'WI', '6085551749');
INSERT INTO parents VALUES (3, 'Eduardo', 'Rodriquez', '2693 Commerce St.', 'McFarland', 'AZ', '6085558763');
INSERT INTO parents VALUES (4, 'Harold', 'Davis', '563 Friendly St.', 'Windsor', 'CO', '6085553198');
INSERT INTO parents VALUES (5, 'Peter', 'McTavish', '2387 S. Fair Way', 'Madison', 'WI', '6085552765');
INSERT INTO parents VALUES (6, 'Jean', 'Coleman', '105 N. Lake St.', 'Monona', 'WI', '6085552654');
INSERT INTO parents VALUES (7, 'Jeff', 'Black', '1450 Oak Blvd.', 'Monona', 'WI', '6085555387');
INSERT INTO parents VALUES (8, 'Maria', 'Escobito', '345 Maple St.', 'Madison', 'WI', '6085557683');
INSERT INTO parents VALUES (9, 'David', 'Schroeder', '2749 Blackhawk Trail', 'Madison', 'WI', '6085559435');
INSERT INTO parents VALUES (10, 'Carlos', 'Estaban', '2335 Independence La.', 'Waunakee', 'WI', '6085555487');
INSERT INTO kids VALUES (1, 'Alyssa', '2000-09-07', 2, 1, 'Claritin', 'None');
INSERT INTO kids VALUES (2, 'Joe', '2002-08-06', 1, 2, 'None', 'Lipitor');

View file

@ -39,6 +39,7 @@ CREATE TABLE parents (
last_name VARCHAR_IGNORECASE(30),
address VARCHAR(255),
city VARCHAR(80),
state VARCHAR(30),
telephone VARCHAR(20)
);
CREATE INDEX parents_last_name ON parents (last_name);

View file

@ -14,6 +14,8 @@
th:replace="~{fragments/inputField :: input ('Address', 'address')}" />
<input
th:replace="~{fragments/inputField :: input ('City', 'city')}" />
<input
th:replace="~{fragments/inputField :: input ('State', 'state')}" />
<input
th:replace="~{fragments/inputField :: input ('Telephone', 'telephone')}" />
</div>

View file

@ -22,6 +22,10 @@
<th>City</th>
<td th:text="*{city}" /></td>
</tr>
<tr>
<th>State</th>
<td th:text="*{state}" /></td>
</tr>
<tr>
<th>Telephone</th>
<td th:text="*{telephone}" /></td>

View file

@ -11,9 +11,10 @@
<tr>
<th style="width: 150px;">Name</th>
<th style="width: 200px;">Address</th>
<th>City</th>
<th style="width: 120px">Telephone</th>
<th>Children</th>
<th style="width: 150px;">City</th>
<th style="width: 150px;">State</th>
<th style="width: 120px;">Telephone</th>
<th style="width: 150px;">Children</th>
</tr>
</thead>
<tbody>
@ -23,6 +24,7 @@
</td>
<td th:text="${parent.address}"/>
<td th:text="${parent.city}"/>
<td th:text="${parent.state}"/>
<td th:text="${parent.telephone}"/>
<td><span th:each="kid : ${parent.kids}" th:text="${kid.name} + ' '"/></td>
</tr>