You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.asciidoc
+117-11
Original file line number
Diff line number
Diff line change
@@ -22,9 +22,42 @@ Persistence
22
22
-----------
23
23
24
24
* Right-click on project, select ``Properties'', search for ``facet'', enable ``JPA'', click on ``Apply'', talk about ``Further configuration available'' and default data source
25
-
* Create a new entity
26
-
* Add a primary key in the wizard. Use `long` datatype and name as `id`.
25
+
* Create a new entity`Student`
26
+
* Add a primary key in the wizard. Use `long` datatype and `id` name.
27
27
* Generate Getter/Setter by clicking ``Source'', ``Getters and Setters''.
28
+
* Add `toString` implementation
29
+
* The updated class should look like:
30
+
+
31
+
[source, java]
32
+
----
33
+
@Entity
34
+
public class Student implements Serializable {
35
+
36
+
@Id
37
+
private long id;
38
+
private static final long serialVersionUID = 1L;
39
+
40
+
public Student() {
41
+
super();
42
+
}
43
+
44
+
public Student(long id) {
45
+
this.id = id;
46
+
}
47
+
public long getId() {
48
+
return this.id;
49
+
}
50
+
51
+
public void setId(long id) {
52
+
this.id = id;
53
+
}
54
+
55
+
public String toString() {
56
+
return "Student[" + id + "]";
57
+
}
58
+
}
59
+
----
60
+
+
28
61
* Add the following properties to `persistence.xml`:
* Access the Servlet in the browser to show the results
64
175
65
176
66
177
* Basic Maven project creation
67
178
** Search for `wildfly-javaee7` archetype - there are 4, which one to choose and when ?
68
-
* JAX-RS
69
-
** Wizards
70
-
** Content assist
71
-
** Validation
72
-
** Navigation
73
179
* CDI
74
180
** Wizards:
75
181
http://docs.jboss.org/tools/4.1.x.Final/en/cdi_tools_reference_guide/html/chap-CDI_Tools_Reference_Guide-Creating_a_CDI_Web_Project.html[New CDI Web Project Wizard],
0 commit comments