Skip to content
Snippets Groups Projects
Commit b109638d authored by Christoph Thelen's avatar Christoph Thelen Committed by Tom Käsler
Browse files

Enforce jackson version; Use our new CouchDB4J fork

parent c3183f4a
Branches
Tags
No related merge requests found
......@@ -10,6 +10,7 @@
<org.springframework-version>4.0.9.RELEASE</org.springframework-version>
<org.springframework.security-version>3.2.5.RELEASE</org.springframework.security-version>
<org.springframework.integration-mail-version>4.0.6.RELEASE</org.springframework.integration-mail-version>
<com.fasterxml.jackson-version>2.5.1</com.fasterxml.jackson-version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.url>https://scm.thm.de/arsnova</project.url>
<sonar.language>java</sonar.language>
......@@ -272,7 +273,12 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.4.5</version>
<version>${com.fasterxml.jackson-version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${com.fasterxml.jackson-version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
......@@ -294,12 +300,6 @@
<artifactId>spring-aspects</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.42.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
......
......@@ -55,6 +55,8 @@ import org.springframework.transaction.annotation.Transactional;
import com.fourspaces.couchdb.Database;
import com.fourspaces.couchdb.Document;
import com.fourspaces.couchdb.Results;
import com.fourspaces.couchdb.RowResult;
import com.fourspaces.couchdb.View;
import com.fourspaces.couchdb.ViewResults;
......@@ -127,17 +129,14 @@ public class CouchDBDao implements IDatabaseDao, ApplicationEventPublisherAware
view.setStartKeyArray(user.getUsername());
view.setEndKeyArray(user.getUsername(), "{}");
final ViewResults sessions = getDatabase().view(view);
final Results<Session> results = getDatabase().queryView(view, Session.class);
final List<Session> result = new ArrayList<Session>();
for (final Document d : sessions.getResults()) {
final Session session = (Session) JSONObject.toBean(
d.getJSONObject().getJSONObject("value"),
Session.class
);
session.setCreator(d.getJSONObject().getJSONArray("key").getString(0));
session.setName(d.getJSONObject().getJSONArray("key").getString(1));
session.set_id(d.getId());
for (final RowResult<Session> row : results.getRows()) {
final Session session = row.getValue();
session.setCreator(row.getKey().getString(0));
session.setName(row.getKey().getString(1));
session.set_id(row.getId());
result.add(session);
}
return result;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment