Browse files

Adding first persistent object

  • Loading branch information...
1 parent 4bdb618 commit 85c271232dcf23d1c1ef1345515b4996ab09bc53 @matthewmccullough committed Apr 22, 2010
View
58 ExerciseGAE/src/com/ambientideas/invoicetimetracking/TimeTracked.java
@@ -0,0 +1,58 @@
+package com.ambientideas.invoicetimetracking;
+
+import java.util.Date;
+
+import javax.jdo.annotations.IdGeneratorStrategy;
+import javax.jdo.annotations.IdentityType;
+import javax.jdo.annotations.PersistenceCapable;
+import javax.jdo.annotations.Persistent;
+import javax.jdo.annotations.PrimaryKey;
+
+@PersistenceCapable(identityType = IdentityType.APPLICATION)
+public class TimeTracked {
+ @PrimaryKey
+ @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
+ private Long id;
+
+ @Persistent
+ private Float hoursWorked;
+
+ @Persistent
+ private String workComments;
+
+ @Persistent
+ private Date date;
+
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public Float getHoursWorked() {
+ return hoursWorked;
+ }
+
+ public void setHoursWorked(Float hoursWorked) {
+ this.hoursWorked = hoursWorked;
+ }
+
+ public String getWorkComments() {
+ return workComments;
+ }
+
+ public void setWorkComments(String workComments) {
+ this.workComments = workComments;
+ }
+
+ public Date getDate() {
+ return date;
+ }
+
+ public void setDate(Date date) {
+ this.date = date;
+ }
+}
View
2 ExerciseGAE/war/index.html
@@ -22,6 +22,8 @@
</tr>
<tr>
<td><a href="addTimeWorked">Add time worked.</a></td>
+ </tr>
+ <tr>
<td><a href="viewTimeWorked">View time worked.</a></td>
</tr>
</table>

0 comments on commit 85c2712

Please sign in to comment.