Author: chathura
Date: Tue Jan 22 20:21:27 2008
New Revision: 12718
Log:
Fixing a bug in keeping the commented time. This should fix the issue
MASHUP-563.
Modified:
trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/dao/CommentsDAO.java
Modified:
trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/dao/CommentsDAO.java
==============================================================================
---
trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/dao/CommentsDAO.java
(original)
+++
trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/dao/CommentsDAO.java
Tue Jan 22 20:21:27 2008
@@ -40,14 +40,14 @@
s.setLong(1, artifactID);
s.setString(2, userID);
s.setString(3, comment.getText());
- s.setDate(4, new Date(now));
+ s.setTimestamp(4, new Timestamp(now));
s.executeUpdate();
sql = "SELECT CM_ID FROM COMMENTS WHERE AID=? AND USER_ID=? AND
COMMENTED_TIME=?";
s = conn.prepareStatement(sql);
s.setLong(1, artifactID);
s.setString(2, userID);
- s.setDate(3, new Date(now));
+ s.setTimestamp(3, new Timestamp(now));
ResultSet result = s.executeQuery();
if (result.next()) {
@@ -63,7 +63,7 @@
long now = System.currentTimeMillis();
PreparedStatement s = conn.prepareStatement(sql);
s.setString(1, text);
- s.setDate(2, new Date(now));
+ s.setTimestamp(2, new Timestamp(now));
s.setLong(3, commentId);
s.executeUpdate();
}
@@ -112,7 +112,7 @@
Comment comment = new Comment();
comment.setText(result.getString(DatabaseConstants.COMMENT_TEXT_FIELD));
comment.setUser(result.getString(DatabaseConstants.COMMENTED_USER_ID_FIELD));
-
comment.setTime(result.getDate(DatabaseConstants.COMMENTED_TIME_FIELD));
+
comment.setTime(result.getTimestamp(DatabaseConstants.COMMENTED_TIME_FIELD));
return comment;
}
_______________________________________________
Registry-dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/registry-dev