Skip to content

Commit

Permalink
Merge pull request #310 from jogrimst/master
Browse files Browse the repository at this point in the history
Added timeCreated to Student
  • Loading branch information
literacyapp authored Dec 11, 2016
2 parents deb23d5 + 9d6ac50 commit 0af68b2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<properties>
<java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<literacyapp.model.version>1.1.30</literacyapp.model.version>
<literacyapp.model.version>1.1.31</literacyapp.model.version>
<hibernate.version>4.3.9.Final</hibernate.version>
<jetty.version>8.1.14.v20131031</jetty.version>
<spring.version>4.2.6.RELEASE</spring.version>
Expand Down
15 changes: 15 additions & 0 deletions src/main/java/org/literacyapp/model/Student.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
package org.literacyapp.model;

import java.util.Calendar;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.ManyToMany;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.NotEmpty;
import org.literacyapp.model.enums.Locale;
Expand All @@ -22,6 +25,10 @@ public class Student extends BaseEntity {
@ManyToMany(fetch = FetchType.EAGER)
private Set<Device> devices;

@NotNull
@Temporal(TemporalType.TIMESTAMP)
private Calendar timeCreated; // Time created on Device

// TODO: avatar

@NotNull
Expand All @@ -36,6 +43,14 @@ public void setUniqueId(String uniqueId) {
this.uniqueId = uniqueId;
}

public Calendar getTimeCreated() {
return timeCreated;
}

public void setTimeCreated(Calendar timeCreated) {
this.timeCreated = timeCreated;
}

public Set<Device> getDevices() {
return devices;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ public static StudentGson getStudentGson(Student student) {
StudentGson studentGson = new StudentGson();

studentGson.setUniqueId(student.getUniqueId());
studentGson.setTimeCreated(student.getTimeCreated());
// studentGson.setAvatar(null);
// studentGson.setDevices(null);

Expand Down

0 comments on commit 0af68b2

Please sign in to comment.