Merge remote-tracking branch 'origin/develop' into feature/nio

This commit is contained in:
Christian Basler 2016-08-17 07:46:52 +02:00
commit 3a92bab9ba
2 changed files with 5 additions and 4 deletions

View File

@ -70,7 +70,11 @@ public abstract class AbstractMessageRepository implements MessageRepository, In
@Override
public List<Plaintext> findMessages(Label label) {
return find("id IN (SELECT message_id FROM Message_Label WHERE label_id=" + label.getId() + ")");
if (label == null) {
return find("id NOT IN (SELECT message_id FROM Message_Label)");
} else {
return find("id IN (SELECT message_id FROM Message_Label WHERE label_id=" + label.getId() + ")");
}
}
@Override

View File

@ -2,7 +2,6 @@ package ch.dissem.bitmessage.repository;
import ch.dissem.bitmessage.InternalContext;
import ch.dissem.bitmessage.entity.ObjectMessage;
import ch.dissem.bitmessage.entity.Plaintext;
import ch.dissem.bitmessage.exception.ApplicationException;
import ch.dissem.bitmessage.factory.Factory;
import ch.dissem.bitmessage.ports.ProofOfWorkRepository;
@ -10,9 +9,7 @@ import ch.dissem.bitmessage.utils.Strings;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.sql.*;
import java.util.LinkedList;
import java.util.List;