-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ed69014
commit 3ccf9a8
Showing
7 changed files
with
29 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 3 additions & 10 deletions
13
backend/src/main/java/net/mzouabi/ng2/server/dto/AbstractDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,10 @@ | ||
package net.mzouabi.ng2.server.dto; | ||
|
||
/** | ||
* Created by mouradzouabi on 05/03/16. | ||
*/ | ||
import lombok.Data; | ||
|
||
@Data | ||
public class AbstractDTO { | ||
|
||
private Long id; | ||
|
||
public Long getId() { | ||
return id; | ||
} | ||
|
||
public void setId(Long id) { | ||
this.id = id; | ||
} | ||
} |
45 changes: 7 additions & 38 deletions
45
backend/src/main/java/net/mzouabi/ng2/server/dto/PersonDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,18 @@ | ||
package net.mzouabi.ng2.server.dto; | ||
|
||
import lombok.Data; | ||
|
||
import java.util.Date; | ||
|
||
/** | ||
* Created by mouradzouabi on 04/12/15. | ||
*/ | ||
@Data | ||
public class PersonDTO extends AbstractDTO { | ||
|
||
String firstname; | ||
|
||
String lastname; | ||
|
||
Integer age; | ||
|
||
Date dateOfBirth; | ||
|
||
public String getFirstname() { | ||
return firstname; | ||
} | ||
|
||
public void setFirstname(String firstname) { | ||
this.firstname = firstname; | ||
} | ||
|
||
public String getLastname() { | ||
return lastname; | ||
} | ||
|
||
public void setLastname(String lastname) { | ||
this.lastname = lastname; | ||
} | ||
private String firstname; | ||
|
||
public Integer getAge() { | ||
return age; | ||
} | ||
private String lastname; | ||
|
||
public void setAge(Integer age) { | ||
this.age = age; | ||
} | ||
private Integer age; | ||
|
||
public Date getDateOfBirth() { | ||
return dateOfBirth; | ||
} | ||
private Date dateOfBirth; | ||
|
||
public void setDateOfBirth(Date dateOfBirth) { | ||
this.dateOfBirth = dateOfBirth; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 8 additions & 21 deletions
29
backend/src/main/java/net/mzouabi/ng2/server/model/AbstractEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,22 @@ | ||
package net.mzouabi.ng2.server.model; | ||
|
||
import lombok.Data; | ||
|
||
import javax.persistence.GeneratedValue; | ||
import javax.persistence.Id; | ||
import javax.persistence.MappedSuperclass; | ||
import javax.persistence.Version; | ||
import java.io.Serializable; | ||
|
||
@Data | ||
@MappedSuperclass | ||
public class AbstractEntity implements Serializable { | ||
|
||
@Id | ||
@GeneratedValue | ||
private Long id; | ||
|
||
@Version | ||
private Integer version; | ||
|
||
public Long getId() { | ||
return id; | ||
} | ||
|
||
public void setId(Long id) { | ||
this.id = id; | ||
} | ||
|
||
public Integer getVersion() { | ||
return version; | ||
} | ||
@Id | ||
@GeneratedValue | ||
private Long id; | ||
|
||
public void setVersion(Integer version) { | ||
this.version = version; | ||
} | ||
@Version | ||
private Integer version; | ||
|
||
} |
36 changes: 7 additions & 29 deletions
36
backend/src/main/java/net/mzouabi/ng2/server/model/Person.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,19 @@ | ||
package net.mzouabi.ng2.server.model; | ||
|
||
import lombok.Data; | ||
|
||
import javax.persistence.Entity; | ||
import javax.persistence.Table; | ||
import java.util.Date; | ||
|
||
@Data | ||
@Entity | ||
public class Person extends AbstractEntity { | ||
|
||
private static final long serialVersionUID = -6321180910534044216L; | ||
|
||
String firstname; | ||
|
||
String lastname; | ||
|
||
Integer age; | ||
|
||
public String getFirstname() { | ||
return firstname; | ||
} | ||
|
||
public void setFirstname(String firstname) { | ||
this.firstname = firstname; | ||
} | ||
private static final long serialVersionUID = -6321180910534044216L; | ||
|
||
public String getLastname() { | ||
return lastname; | ||
} | ||
private String firstname; | ||
|
||
public void setLastname(String lastname) { | ||
this.lastname = lastname; | ||
} | ||
private String lastname; | ||
|
||
public Integer getAge() { | ||
return age; | ||
} | ||
private Integer age; | ||
|
||
public void setAge(Integer age) { | ||
this.age = age; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters