From 04a883910935363450bd523d220f874f83a667da Mon Sep 17 00:00:00 2001 From: Adam Gavronek Date: Thu, 29 Jan 2015 14:49:51 +0100 Subject: [PATCH] Fix RB-43 added creationTime getters to entity and transformator --- .../acis/bazaar/service/dal/entities/Comment.java | 15 ++++++++++++++- .../dal/transform/CommentTransformator.java | 1 + 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java index 6e9f3663..74e9a146 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/entities/Comment.java @@ -23,6 +23,8 @@ import jodd.vtor.constraint.*; +import java.util.Date; + /** * @author Adam Gavronek * @since 6/11/2014 @@ -40,13 +42,14 @@ public class Comment extends EntityBase { @Min(-1) private final int creatorId; + private final Date creationTime; public Comment(Builder builder) { Id = builder.id; this.message = builder.message; this.creatorId = builder.userId; this.requirementId = builder.requirementId; - + this.creationTime = builder.creationTime; } public int getRequirementId() { @@ -65,6 +68,10 @@ public int getCreatorId() { return creatorId; } + public Date getCreationTime() { + return creationTime; + } + public static Builder getBuilder(String message) { return new Builder(message); } @@ -74,6 +81,7 @@ public static class Builder { private String message; private int userId; private int requirementId; + public Date creationTime; public Builder(String message) { @@ -95,6 +103,11 @@ public Builder creatorId(int creatorId) { return this; } + public Builder creationTime(Date creationTime) { + this.creationTime = creationTime; + return this; + } + public Comment build() { return new Comment(this); } diff --git a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/CommentTransformator.java b/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/CommentTransformator.java index 4f97eda7..d96bbe0f 100644 --- a/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/CommentTransformator.java +++ b/src/main/de/rwth/dbis/acis/bazaar/service/dal/transform/CommentTransformator.java @@ -52,6 +52,7 @@ public Comment mapToEntity(CommentsRecord record) { .id(record.getId()) .requirementId(record.getRequirementId()) .creatorId(record.getUserId()) + .creationTime(record.getCreationTime()) .build(); }