diff --git a/src/main/java/com/noorq/casser/Example.java b/src/main/java/com/noorq/casser/Example.java index 234043c..a21c971 100644 --- a/src/main/java/com/noorq/casser/Example.java +++ b/src/main/java/com/noorq/casser/Example.java @@ -43,12 +43,12 @@ public class Example { @Override public String name() { - return t.v1; + return t._1; } @Override public Integer age() { - return t.v2; + return t._2; } }; @@ -87,7 +87,7 @@ public class Example { session.upsert(newUser); String nameAndAge = session.select(user::name, user::age).where(user::id, "==", 100L).sync().findFirst().map(t -> { - return t.v1 + ":" + t.v2; + return t._1 + ":" + t._2; }).get(); User userTmp = session.select(user::name, user::age).where(user::id, "==", 100L).map(Example::mapUser).sync().findFirst().get(); diff --git a/src/main/java/com/noorq/casser/core/tuple/Tuple1.java b/src/main/java/com/noorq/casser/core/tuple/Tuple1.java index 1d7710e..70435c0 100644 --- a/src/main/java/com/noorq/casser/core/tuple/Tuple1.java +++ b/src/main/java/com/noorq/casser/core/tuple/Tuple1.java @@ -22,15 +22,15 @@ import com.noorq.casser.core.reflect.CasserPropertyNode; import com.noorq.casser.mapping.CasserMappingProperty; import com.noorq.casser.mapping.value.ColumnValueProvider; -public final class Tuple1 { +public final class Tuple1 { - public final V1 v1; + public final A _1; - public Tuple1(V1 v1) { - this.v1 = v1; + public Tuple1(A v1) { + this._1 = v1; } - public final static class Mapper implements Function> { + public final static class Mapper implements Function> { private final ColumnValueProvider provider; private final CasserMappingProperty p1; @@ -41,15 +41,15 @@ public final class Tuple1 { } @Override - public Tuple1 apply(Row row) { - return new Tuple1(provider.getColumnValue(row, 0, p1)); + public Tuple1 apply(Row row) { + return new Tuple1(provider.getColumnValue(row, 0, p1)); } } @Override public String toString() { - return "Tuple1 [v1=" + v1 + "]"; + return "Tuple1 [_1=" + _1 + "]"; } diff --git a/src/main/java/com/noorq/casser/core/tuple/Tuple2.java b/src/main/java/com/noorq/casser/core/tuple/Tuple2.java index 1e1928e..ce56eae 100644 --- a/src/main/java/com/noorq/casser/core/tuple/Tuple2.java +++ b/src/main/java/com/noorq/casser/core/tuple/Tuple2.java @@ -22,17 +22,17 @@ import com.noorq.casser.core.reflect.CasserPropertyNode; import com.noorq.casser.mapping.CasserMappingProperty; import com.noorq.casser.mapping.value.ColumnValueProvider; -public final class Tuple2 { +public final class Tuple2 { - public final V1 v1; - public final V2 v2; + public final A _1; + public final B _2; - public Tuple2(V1 v1, V2 v2) { - this.v1 = v1; - this.v2 = v2; + public Tuple2(A v1, B v2) { + this._1 = v1; + this._2 = v2; } - public final static class Mapper implements Function> { + public final static class Mapper implements Function> { private final ColumnValueProvider provider; private final CasserMappingProperty p1; @@ -47,8 +47,8 @@ public final class Tuple2 { } @Override - public Tuple2 apply(Row row) { - return new Tuple2( + public Tuple2 apply(Row row) { + return new Tuple2( provider.getColumnValue(row, 0, p1), provider.getColumnValue(row, 1, p2)); } @@ -56,7 +56,7 @@ public final class Tuple2 { @Override public String toString() { - return "Tuple2 [v1=" + v1 + ", v2=" + v2 + "]"; + return "Tuple2 [_1=" + _1 + ", _2=" + _2 + "]"; } diff --git a/src/main/java/com/noorq/casser/core/tuple/Tuple3.java b/src/main/java/com/noorq/casser/core/tuple/Tuple3.java index 53a3ac9..eb0b9d7 100644 --- a/src/main/java/com/noorq/casser/core/tuple/Tuple3.java +++ b/src/main/java/com/noorq/casser/core/tuple/Tuple3.java @@ -22,19 +22,19 @@ import com.noorq.casser.core.reflect.CasserPropertyNode; import com.noorq.casser.mapping.CasserMappingProperty; import com.noorq.casser.mapping.value.ColumnValueProvider; -public final class Tuple3 { +public final class Tuple3 { - public final V1 v1; - public final V2 v2; - public final V3 v3; + public final A _1; + public final B _2; + public final C _3; - public Tuple3(V1 v1, V2 v2, V3 v3) { - this.v1 = v1; - this.v2 = v2; - this.v3 = v3; + public Tuple3(A v1, B v2, C v3) { + this._1 = v1; + this._2 = v2; + this._3 = v3; } - public final static class Mapper implements Function> { + public final static class Mapper implements Function> { private final ColumnValueProvider provider; private final CasserMappingProperty p1; @@ -52,8 +52,8 @@ public final class Tuple3 { } @Override - public Tuple3 apply(Row row) { - return new Tuple3( + public Tuple3 apply(Row row) { + return new Tuple3( provider.getColumnValue(row, 0, p1), provider.getColumnValue(row, 1, p2), provider.getColumnValue(row, 2, p3) @@ -63,7 +63,7 @@ public final class Tuple3 { @Override public String toString() { - return "Tuple3 [v1=" + v1 + ", v2=" + v2 + ", v3=" + v3 + "]"; + return "Tuple3 [_1=" + _1 + ", _2=" + _2 + ", _3=" + _3 + "]"; } diff --git a/src/main/java/com/noorq/casser/core/tuple/Tuple4.java b/src/main/java/com/noorq/casser/core/tuple/Tuple4.java index aed6918..72773fc 100644 --- a/src/main/java/com/noorq/casser/core/tuple/Tuple4.java +++ b/src/main/java/com/noorq/casser/core/tuple/Tuple4.java @@ -22,21 +22,21 @@ import com.noorq.casser.core.reflect.CasserPropertyNode; import com.noorq.casser.mapping.CasserMappingProperty; import com.noorq.casser.mapping.value.ColumnValueProvider; -public final class Tuple4 { +public final class Tuple4 { - public final V1 v1; - public final V2 v2; - public final V3 v3; - public final V4 v4; + public final A _1; + public final B _2; + public final C _3; + public final D _4; - public Tuple4(V1 v1, V2 v2, V3 v3, V4 v4) { - this.v1 = v1; - this.v2 = v2; - this.v3 = v3; - this.v4 = v4; + public Tuple4(A v1, B v2, C v3, D v4) { + this._1 = v1; + this._2 = v2; + this._3 = v3; + this._4 = v4; } - public final static class Mapper implements Function> { + public final static class Mapper implements Function> { private final ColumnValueProvider provider; private final CasserMappingProperty p1; @@ -58,8 +58,8 @@ public final class Tuple4 { } @Override - public Tuple4 apply(Row row) { - return new Tuple4( + public Tuple4 apply(Row row) { + return new Tuple4( provider.getColumnValue(row, 0, p1), provider.getColumnValue(row, 1, p2), provider.getColumnValue(row, 2, p3), @@ -70,7 +70,7 @@ public final class Tuple4 { @Override public String toString() { - return "Tuple4 [v1=" + v1 + ", v2=" + v2 + ", v3=" + v3 + ", v4=" + v4 + return "Tuple4 [_1=" + _1 + ", _2=" + _2 + ", _3=" + _3 + ", _4=" + _4 + "]"; } diff --git a/src/main/java/com/noorq/casser/core/tuple/Tuple5.java b/src/main/java/com/noorq/casser/core/tuple/Tuple5.java index 1aefaf7..8606246 100644 --- a/src/main/java/com/noorq/casser/core/tuple/Tuple5.java +++ b/src/main/java/com/noorq/casser/core/tuple/Tuple5.java @@ -22,23 +22,23 @@ import com.noorq.casser.core.reflect.CasserPropertyNode; import com.noorq.casser.mapping.CasserMappingProperty; import com.noorq.casser.mapping.value.ColumnValueProvider; -public final class Tuple5 { +public final class Tuple5 { - public final V1 v1; - public final V2 v2; - public final V3 v3; - public final V4 v4; - public final V5 v5; + public final A _1; + public final B _2; + public final C _3; + public final D _4; + public final E _5; - public Tuple5(V1 v1, V2 v2, V3 v3, V4 v4, V5 v5) { - this.v1 = v1; - this.v2 = v2; - this.v3 = v3; - this.v4 = v4; - this.v5 = v5; + public Tuple5(A v1, B v2, C v3, D v4, E v5) { + this._1 = v1; + this._2 = v2; + this._3 = v3; + this._4 = v4; + this._5 = v5; } - public final static class Mapper implements Function> { + public final static class Mapper implements Function> { private final ColumnValueProvider provider; private final CasserMappingProperty p1, p2, p3, p4, p5; @@ -59,8 +59,8 @@ public final class Tuple5 { } @Override - public Tuple5 apply(Row row) { - return new Tuple5( + public Tuple5 apply(Row row) { + return new Tuple5( provider.getColumnValue(row, 0, p1), provider.getColumnValue(row, 1, p2), provider.getColumnValue(row, 2, p3), @@ -72,8 +72,8 @@ public final class Tuple5 { @Override public String toString() { - return "Tuple5 [v1=" + v1 + ", v2=" + v2 + ", v3=" + v3 + ", v4=" + v4 - + ", v5=" + v5 + "]"; + return "Tuple5 [_1=" + _1 + ", _2=" + _2 + ", _3=" + _3 + ", _4=" + _4 + + ", _5=" + _5 + "]"; } diff --git a/src/main/java/com/noorq/casser/core/tuple/Tuple6.java b/src/main/java/com/noorq/casser/core/tuple/Tuple6.java index b8e53d5..21c7334 100644 --- a/src/main/java/com/noorq/casser/core/tuple/Tuple6.java +++ b/src/main/java/com/noorq/casser/core/tuple/Tuple6.java @@ -22,27 +22,27 @@ import com.noorq.casser.core.reflect.CasserPropertyNode; import com.noorq.casser.mapping.CasserMappingProperty; import com.noorq.casser.mapping.value.ColumnValueProvider; -public final class Tuple6 { +public final class Tuple6 { - public final V1 v1; - public final V2 v2; - public final V3 v3; - public final V4 v4; - public final V5 v5; - public final V6 v6; + public final A _1; + public final B _2; + public final C _3; + public final D _4; + public final E _5; + public final F _6; - public Tuple6(V1 v1, V2 v2, V3 v3, V4 v4, V5 v5, V6 v6) { - this.v1 = v1; - this.v2 = v2; - this.v3 = v3; - this.v4 = v4; - this.v5 = v5; - this.v6 = v6; + public Tuple6(A v1, B v2, C v3, D v4, E v5, F v6) { + this._1 = v1; + this._2 = v2; + this._3 = v3; + this._4 = v4; + this._5 = v5; + this._6 = v6; } - public final static class Mapper implements + public final static class Mapper implements Function> { + Tuple6> { private final ColumnValueProvider provider; private final CasserMappingProperty p1, p2, p3, p4, p5, p6; @@ -65,8 +65,8 @@ public final class Tuple6 { } @Override - public Tuple6 apply(Row row) { - return new Tuple6( + public Tuple6 apply(Row row) { + return new Tuple6( provider.getColumnValue(row, 0, p1), provider.getColumnValue(row, 1, p2), provider.getColumnValue(row, 2, p3), @@ -79,8 +79,8 @@ public final class Tuple6 { @Override public String toString() { - return "Tuple6 [v1=" + v1 + ", v2=" + v2 + ", v3=" + v3 + ", v4=" + v4 - + ", v5=" + v5 + ", v6=" + v6 + "]"; + return "Tuple6 [_1=" + _1 + ", _2=" + _2 + ", _3=" + _3 + ", _4=" + _4 + + ", _5=" + _5 + ", _6=" + _6 + "]"; } diff --git a/src/main/java/com/noorq/casser/core/tuple/Tuple7.java b/src/main/java/com/noorq/casser/core/tuple/Tuple7.java index 91fda62..6468610 100644 --- a/src/main/java/com/noorq/casser/core/tuple/Tuple7.java +++ b/src/main/java/com/noorq/casser/core/tuple/Tuple7.java @@ -22,29 +22,29 @@ import com.noorq.casser.core.reflect.CasserPropertyNode; import com.noorq.casser.mapping.CasserMappingProperty; import com.noorq.casser.mapping.value.ColumnValueProvider; -public final class Tuple7 { +public final class Tuple7 { - public final V1 v1; - public final V2 v2; - public final V3 v3; - public final V4 v4; - public final V5 v5; - public final V6 v6; - public final V7 v7; + public final A _1; + public final B _2; + public final C _3; + public final D _4; + public final E _5; + public final F _6; + public final G _7; - public Tuple7(V1 v1, V2 v2, V3 v3, V4 v4, V5 v5, V6 v6, V7 v7) { - this.v1 = v1; - this.v2 = v2; - this.v3 = v3; - this.v4 = v4; - this.v5 = v5; - this.v6 = v6; - this.v7 = v7; + public Tuple7(A v1, B v2, C v3, D v4, E v5, F v6, G v7) { + this._1 = v1; + this._2 = v2; + this._3 = v3; + this._4 = v4; + this._5 = v5; + this._6 = v6; + this._7 = v7; } - public final static class Mapper implements + public final static class Mapper implements Function> { + Tuple7> { private final ColumnValueProvider provider; private final CasserMappingProperty p1, p2, p3, p4, p5, p6, p7; @@ -69,8 +69,8 @@ public final class Tuple7 { } @Override - public Tuple7 apply(Row row) { - return new Tuple7( + public Tuple7 apply(Row row) { + return new Tuple7( provider.getColumnValue(row, 0, p1), provider.getColumnValue(row, 1, p2), provider.getColumnValue(row, 2, p3), @@ -84,8 +84,8 @@ public final class Tuple7 { @Override public String toString() { - return "Tuple7 [v1=" + v1 + ", v2=" + v2 + ", v3=" + v3 + ", v4=" + v4 - + ", v5=" + v5 + ", v6=" + v6 + ", v7=" + v7 + "]"; + return "Tuple7 [_1=" + _1 + ", _2=" + _2 + ", _3=" + _3 + ", _4=" + _4 + + ", _5=" + _5 + ", _6=" + _6 + ", _7=" + _7 + "]"; } diff --git a/src/test/java/com/noorq/casser/test/integration/core/compound/CompondKeyTest.java b/src/test/java/com/noorq/casser/test/integration/core/compound/CompondKeyTest.java index f52b3a8..1a2cf59 100644 --- a/src/test/java/com/noorq/casser/test/integration/core/compound/CompondKeyTest.java +++ b/src/test/java/com/noorq/casser/test/integration/core/compound/CompondKeyTest.java @@ -97,9 +97,9 @@ public class CompondKeyTest extends AbstractEmbeddedCassandraTest { Date cd = d.get(); if (cd != null) { - Assert.assertTrue(cd.after(t.v2)); + Assert.assertTrue(cd.after(t._2)); } - d.set(t.v2); + d.set(t._2); }); diff --git a/src/test/java/com/noorq/casser/test/integration/core/simple/SimpleUserTest.java b/src/test/java/com/noorq/casser/test/integration/core/simple/SimpleUserTest.java index a7896a8..a34e735 100644 --- a/src/test/java/com/noorq/casser/test/integration/core/simple/SimpleUserTest.java +++ b/src/test/java/com/noorq/casser/test/integration/core/simple/SimpleUserTest.java @@ -81,7 +81,7 @@ public class SimpleUserTest extends AbstractEmbeddedCassandraTest { String name = session.select(user::name) .where(user::id, "==", 123L) - .map(t -> "_" + t.v1) + .map(t -> "_" + t._1) .sync() .findFirst() .get();