Last active
May 12, 2016 15:19
-
-
Save mp911de/b61a1a24bd824d0742a6b2e31ecb4861 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| String id = "1"; | |
| long time = 12345L; | |
| // CREATE TABLE timeentity (id varchar PRIMARY KEY, time time); | |
| PreparedStatement prepare = session.prepare("INSERT INTO timeentity (id, time) values(?,?)"); | |
| BoundStatement boundStatement = prepare.bind(id, time); | |
| session.execute(boundStatement); // works | |
| Insert insert = QueryBuilder.insertInto("timeentity").value("id", id).value("time", time); | |
| session.execute(insert); // fails with: | |
| // Caused by: com.datastax.driver.core.exceptions.InvalidQueryException: Invalid INTEGER constant (21312214) for "time" of type time |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment