insertInto("foo").value("k", 1).value("v", now()), insertInto("foo").value("k", 1).value("v", uuid()), insertInto("foo").value("k", 1).value("v", Sets.newHashSet(fcall("token", "k"))), insertInto("foo").value("k", 1).value("v", Sets.newHashSet(now())), insertInto("foo").value("k", 1).value("v", Sets.newHashSet(uuid())), insertInto("foo").values(new String[] {"k", "v"}, new Object[] {1, fcall("token", "k")}), insertInto("foo").values(new String[] {"k", "v"}, new Object[] {1, now()}), insertInto("foo").values(new String[] {"k", "v"}, new Object[] {1, uuid()}), insertInto("foo") new Object[] {1, ImmutableMap.of("foo", fcall("token", "k"))}), insertInto("foo") .values(new String[] {"k", "v"}, new Object[] {1, ImmutableMap.of("foo", now())}), insertInto("foo") .values(new String[] {"k", "v"}, new Object[] {1, ImmutableMap.of("foo", uuid())}), new Object[] {1, ImmutableMap.of(fcall("token", "k"), "foo")}), insertInto("foo") .values(new String[] {"k", "v"}, new Object[] {1, ImmutableMap.of(now(), "foo")}), insertInto("foo") .values(new String[] {"k", "v"}, new Object[] {1, ImmutableMap.of(uuid(), "foo")}), update("foo").with(set("v", fcall("token", "k"))).where(eq("k", 1)), update("foo").with(set("v", now())).where(eq("k", 1)), update("foo").with(set("v", uuid())).where(eq("k", 1)), update("foo").with(set("v", Lists.newArrayList(fcall("token", "k")))).where(eq("k", 1)), update("foo").with(set("v", Lists.newArrayList(now()))).where(eq("k", 1)), update("foo").with(set("v", Lists.newArrayList(uuid()))).where(eq("k", 1)), delete().from("foo").where(lt("k", fcall("now"))), delete().from("foo").where(lt("k", now())),
@Override public void write(final GeoWaveMetadata metadata) { final Insert insert = operations.getInsert(tableName); insert.value(PRIMARY_ID_KEY, ByteBuffer.wrap(metadata.getPrimaryId())); if (metadata.getSecondaryId() != null) { insert.value(SECONDARY_ID_KEY, ByteBuffer.wrap(metadata.getSecondaryId())); insert.value(TIMESTAMP_ID_KEY, QueryBuilder.now()); if (metadata.getVisibility() != null && metadata.getVisibility().length > 0) { insert.value(VISIBILITY_KEY, ByteBuffer.wrap(metadata.getVisibility())); } } insert.value(VALUE_KEY, ByteBuffer.wrap(metadata.getValue())); operations.getSession().execute(insert); }
private Statement createInsertStatementToSaveFollowing(User user, Application app) { UUID userId = UUID.fromString(user.userId); UUID appId = UUID.fromString(app.applicationId); BatchStatement batch = new BatchStatement(); Statement insertIntoAppFollowersTable = queryBuilder .insertInto(Follow.TABLE_NAME_APP_FOLLOWERS) .value(APP_ID, appId) .value(USER_ID, userId) .value(APP_NAME, app.name) .value(USER_FIRST_NAME, user.firstName) .value(TIME_OF_FOLLOW, now()); batch.add(insertIntoAppFollowersTable); Statement insertIntoUserFollowingsTable = queryBuilder .insertInto(Follow.TABLE_NAME_USER_FOLLOWING) .value(APP_ID, appId) .value(USER_ID, userId) .value(APP_NAME, app.name) .value(USER_FIRST_NAME, user.firstName) .value(TIME_OF_FOLLOW, now()); batch.add(insertIntoUserFollowingsTable); return batch; }
insertInto("foo").value("k", 1).value("v", now()), insertInto("foo").value("k", 1).value("v", uuid()), insertInto("foo").value("k", 1).value("v", Sets.newHashSet(fcall("token", "k"))), insertInto("foo").value("k", 1).value("v", Sets.newHashSet(now())), insertInto("foo").value("k", 1).value("v", Sets.newHashSet(uuid())), insertInto("foo").values(new String[] {"k", "v"}, new Object[] {1, fcall("token", "k")}), insertInto("foo").values(new String[] {"k", "v"}, new Object[] {1, now()}), insertInto("foo").values(new String[] {"k", "v"}, new Object[] {1, uuid()}), insertInto("foo") new Object[] {1, ImmutableMap.of("foo", fcall("token", "k"))}), insertInto("foo") .values(new String[] {"k", "v"}, new Object[] {1, ImmutableMap.of("foo", now())}), insertInto("foo") .values(new String[] {"k", "v"}, new Object[] {1, ImmutableMap.of("foo", uuid())}), new Object[] {1, ImmutableMap.of(fcall("token", "k"), "foo")}), insertInto("foo") .values(new String[] {"k", "v"}, new Object[] {1, ImmutableMap.of(now(), "foo")}), insertInto("foo") .values(new String[] {"k", "v"}, new Object[] {1, ImmutableMap.of(uuid(), "foo")}), update("foo").with(set("v", fcall("token", "k"))).where(eq("k", 1)), update("foo").with(set("v", now())).where(eq("k", 1)), update("foo").with(set("v", uuid())).where(eq("k", 1)), update("foo").with(set("v", Lists.newArrayList(fcall("token", "k")))).where(eq("k", 1)), update("foo").with(set("v", Lists.newArrayList(now()))).where(eq("k", 1)), update("foo").with(set("v", Lists.newArrayList(uuid()))).where(eq("k", 1)), delete().from("foo").where(lt("k", fcall("now"))), delete().from("foo").where(lt("k", now())),