diff --git a/helenus-core.iml b/helenus-core.iml
index 77f2a38..42b1cc5 100644
--- a/helenus-core.iml
+++ b/helenus-core.iml
@@ -11,8 +11,6 @@
-
-
diff --git a/pom.xml b/pom.xml
index 89abb41..cd51b84 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
4.0.0
net.helenus
helenus-core
- 2.0.5-SNAPSHOT
+ 2.0.6-SNAPSHOT
jar
helenus
diff --git a/src/main/java/net/helenus/core/AbstractSessionOperations.java b/src/main/java/net/helenus/core/AbstractSessionOperations.java
index 36a5145..6f136b8 100644
--- a/src/main/java/net/helenus/core/AbstractSessionOperations.java
+++ b/src/main/java/net/helenus/core/AbstractSessionOperations.java
@@ -52,6 +52,8 @@ public abstract class AbstractSessionOperations {
abstract public ColumnValuePreparer getValuePreparer();
+ abstract public ConsistencyLevel getDefaultConsistencyLevel();
+
public PreparedStatement prepare(RegularStatement statement) {
try {
diff --git a/src/main/java/net/helenus/core/HelenusSession.java b/src/main/java/net/helenus/core/HelenusSession.java
index 15cff2b..df5c6fe 100644
--- a/src/main/java/net/helenus/core/HelenusSession.java
+++ b/src/main/java/net/helenus/core/HelenusSession.java
@@ -46,6 +46,7 @@ public final class HelenusSession extends AbstractSessionOperations implements C
private final CodecRegistry registry;
private volatile String usingKeyspace;
private volatile boolean showCql;
+ private final ConsistencyLevel defaultConsistencyLevel;
private final PrintStream printStream;
private final SessionRepository sessionRepository;
private final Executor executor;
@@ -59,7 +60,7 @@ public final class HelenusSession extends AbstractSessionOperations implements C
HelenusSession(Session session, String usingKeyspace, CodecRegistry registry, boolean showCql,
PrintStream printStream, SessionRepositoryBuilder sessionRepositoryBuilder, Executor executor,
- boolean dropSchemaOnClose) {
+ boolean dropSchemaOnClose, ConsistencyLevel consistencyLevel) {
this.session = session;
this.registry = registry == null ? CodecRegistry.DEFAULT_INSTANCE : registry;
this.usingKeyspace = Objects.requireNonNull(usingKeyspace,
@@ -69,6 +70,7 @@ public final class HelenusSession extends AbstractSessionOperations implements C
this.sessionRepository = sessionRepositoryBuilder.build();
this.executor = executor;
this.dropSchemaOnClose = dropSchemaOnClose;
+ this.defaultConsistencyLevel = consistencyLevel;
this.valueProvider = new RowColumnValueProvider(this.sessionRepository);
this.valuePreparer = new StatementColumnValuePreparer(this.sessionRepository);
@@ -134,6 +136,10 @@ public final class HelenusSession extends AbstractSessionOperations implements C
return valuePreparer;
}
+ public ConsistencyLevel getDefaultConsistencyLevel() {
+ return defaultConsistencyLevel;
+ }
+
public Metadata getMetadata() { return metadata; }
public synchronized UnitOfWork begin() {
diff --git a/src/main/java/net/helenus/core/SessionInitializer.java b/src/main/java/net/helenus/core/SessionInitializer.java
index 04470f5..21414b4 100644
--- a/src/main/java/net/helenus/core/SessionInitializer.java
+++ b/src/main/java/net/helenus/core/SessionInitializer.java
@@ -15,19 +15,8 @@
*/
package net.helenus.core;
-import java.io.IOException;
-import java.io.PrintStream;
-import java.util.*;
-import java.util.concurrent.Executor;
-import java.util.concurrent.Executors;
-import java.util.function.Consumer;
-import java.util.stream.Collector;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
import com.datastax.driver.core.*;
import com.google.common.util.concurrent.MoreExecutors;
-
import net.helenus.mapping.HelenusEntity;
import net.helenus.mapping.HelenusEntityType;
import net.helenus.mapping.value.ColumnValuePreparer;
@@ -35,235 +24,253 @@ import net.helenus.mapping.value.ColumnValueProvider;
import net.helenus.support.HelenusException;
import net.helenus.support.PackageUtil;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.util.*;
+import java.util.concurrent.Executor;
+import java.util.concurrent.Executors;
+import java.util.function.Consumer;
+
public final class SessionInitializer extends AbstractSessionOperations {
- private final Session session;
- private CodecRegistry registry;
- private String usingKeyspace;
- private boolean showCql = false;
- private PrintStream printStream = System.out;
- private Executor executor = MoreExecutors.directExecutor();
+ private final Session session;
+ private CodecRegistry registry;
+ private String usingKeyspace;
+ private boolean showCql = false;
+ private ConsistencyLevel consistencyLevel;
+ private PrintStream printStream = System.out;
+ private Executor executor = MoreExecutors.directExecutor();
- private SessionRepositoryBuilder sessionRepository;
+ private SessionRepositoryBuilder sessionRepository;
- private boolean dropUnusedColumns = false;
- private boolean dropUnusedIndexes = false;
+ private boolean dropUnusedColumns = false;
+ private boolean dropUnusedIndexes = false;
- private KeyspaceMetadata keyspaceMetadata;
+ private KeyspaceMetadata keyspaceMetadata;
- private final List