From a43e28ba06f57c8d4aec160d639f88f2da66f3ea Mon Sep 17 00:00:00 2001 From: Alex Shvid Date: Sat, 14 Mar 2015 10:00:27 -0700 Subject: [PATCH] refactor prepared statements --- src/casser/Example.java | 5 ++--- src/casser/core/Prepared.java | 10 ++++++++++ src/casser/core/PreparedStatement.java | 11 ----------- src/casser/core/PreparedStreamStatement.java | 11 ----------- src/casser/operation/AbstractOperation.java | 4 ++-- src/casser/operation/AbstractStreamOperation.java | 4 ++-- 6 files changed, 16 insertions(+), 29 deletions(-) create mode 100644 src/casser/core/Prepared.java delete mode 100644 src/casser/core/PreparedStatement.java delete mode 100644 src/casser/core/PreparedStreamStatement.java diff --git a/src/casser/Example.java b/src/casser/Example.java index 255c9a6..272961d 100644 --- a/src/casser/Example.java +++ b/src/casser/Example.java @@ -1,7 +1,7 @@ package casser; import casser.core.Casser; -import casser.core.PreparedStreamStatement; +import casser.core.Prepared; import casser.core.Session; import casser.operation.SelectOperation; import casser.tuple.Tuple1; @@ -38,8 +38,7 @@ public class Example { session.delete().where(_user::getId, "==", 100L).async(); - - PreparedStreamStatement, SelectOperation>> ps = session.select(_user::getName).where(_user::getId, "==", null).prepare(); + Prepared>> ps = session.select(_user::getName).where(_user::getId, "==", null).prepare(); long cnt = ps.bind(100L).sync().count(); diff --git a/src/casser/core/Prepared.java b/src/casser/core/Prepared.java new file mode 100644 index 0000000..4ce172b --- /dev/null +++ b/src/casser/core/Prepared.java @@ -0,0 +1,10 @@ +package casser.core; + + +public class Prepared { + + public O bind(Object... params) { + return null; + } + +} diff --git a/src/casser/core/PreparedStatement.java b/src/casser/core/PreparedStatement.java deleted file mode 100644 index e5bb54e..0000000 --- a/src/casser/core/PreparedStatement.java +++ /dev/null @@ -1,11 +0,0 @@ -package casser.core; - -import casser.operation.AbstractOperation; - -public class PreparedStatement> { - - public AbstractOperation bind(Object... params) { - return null; - } - -} diff --git a/src/casser/core/PreparedStreamStatement.java b/src/casser/core/PreparedStreamStatement.java deleted file mode 100644 index 31161b5..0000000 --- a/src/casser/core/PreparedStreamStatement.java +++ /dev/null @@ -1,11 +0,0 @@ -package casser.core; - -import casser.operation.AbstractStreamOperation; - -public class PreparedStreamStatement> { - - public AbstractStreamOperation bind(Object... params) { - return null; - } - -} diff --git a/src/casser/operation/AbstractOperation.java b/src/casser/operation/AbstractOperation.java index 54724b5..c16202f 100644 --- a/src/casser/operation/AbstractOperation.java +++ b/src/casser/operation/AbstractOperation.java @@ -2,11 +2,11 @@ package casser.operation; import java.util.concurrent.Future; -import casser.core.PreparedStatement; +import casser.core.Prepared; public abstract class AbstractOperation> { - public PreparedStatement prepare() { + public Prepared prepare() { return null; } diff --git a/src/casser/operation/AbstractStreamOperation.java b/src/casser/operation/AbstractStreamOperation.java index 75f37fd..2d2df86 100644 --- a/src/casser/operation/AbstractStreamOperation.java +++ b/src/casser/operation/AbstractStreamOperation.java @@ -3,11 +3,11 @@ package casser.operation; import java.util.concurrent.Future; import java.util.stream.Stream; -import casser.core.PreparedStreamStatement; +import casser.core.Prepared; public abstract class AbstractStreamOperation> { - public PreparedStreamStatement prepare() { + public Prepared prepare() { return null; }