UNRATED rating should have ordinal 0 so it corresponds to SQL NULL.

This commit is contained in:
akwizgran
2013-04-12 20:16:34 +01:00
parent dae56cc573
commit 4f58a8aee4
2 changed files with 2 additions and 1 deletions

View File

@@ -2,5 +2,5 @@ package net.sf.briar.api.messaging;
/** The ratings that may be applied to an author in peer moderation. */
public enum Rating {
BAD, UNRATED, GOOD
UNRATED, BAD, GOOD
}

View File

@@ -1522,6 +1522,7 @@ abstract class JdbcDatabase implements Database<Connection> {
String authorName = rs.getString(4);
byte[] authorKey = rs.getBytes(5);
author = new Author(authorId, authorName, authorKey);
// NULL == 0 == UNRATED
rating = Rating.values()[rs.getByte(6)];
}
String contentType = rs.getString(7);