mirror of
https://github.com/ClaytonWWilson/Listify.git
synced 2025-12-16 10:48:46 +00:00
Enforce schema matching
Ensure all Lambdas and tests follow the current db schema
This commit is contained in:
parent
56c9a3f99d
commit
a43776e5dc
@ -1,6 +1,7 @@
|
|||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
import java.sql.PreparedStatement;
|
import java.sql.PreparedStatement;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
|
import java.sql.Timestamp;
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.time.ZoneOffset;
|
import java.time.ZoneOffset;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@ -25,7 +26,7 @@ public class ListEntryAdder implements CallHandler {
|
|||||||
statement.setInt(1, (Integer) bodyMap.get("productID"));
|
statement.setInt(1, (Integer) bodyMap.get("productID"));
|
||||||
statement.setInt(2, (Integer) bodyMap.get("listID"));
|
statement.setInt(2, (Integer) bodyMap.get("listID"));
|
||||||
statement.setInt(3, (Integer) bodyMap.get("quantity"));
|
statement.setInt(3, (Integer) bodyMap.get("quantity"));
|
||||||
statement.setObject(4, Instant.now().atZone(ZoneOffset.UTC).toLocalDateTime());
|
statement.setTimestamp(4, Timestamp.from(Instant.now()));
|
||||||
statement.setBoolean(5, (Boolean) bodyMap.get("purchased"));
|
statement.setBoolean(5, (Boolean) bodyMap.get("purchased"));
|
||||||
System.out.println(statement);
|
System.out.println(statement);
|
||||||
statement.executeUpdate();
|
statement.executeUpdate();
|
||||||
|
|||||||
@ -84,7 +84,7 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
//The name is the only part of this that is used, the rest is generated by the Lambda.
|
//The name is the only part of this that is used, the rest is generated by the Lambda.
|
||||||
List testList = new List(-1, "New List", "user filled by lambda", Instant.now().toEpochMilli());
|
List testList = new List(-1, "New List", "user filled by lambda", Instant.now().toEpochMilli());
|
||||||
//Everything except addedDate is used for ItemEntry
|
//Everything except addedDate is used for ItemEntry
|
||||||
ListEntry entry = new ListEntry(1, 1, new Random().nextInt(), Instant.now().toEpochMilli(),false);
|
ListEntry entry = new ListEntry(1, 4, Math.abs(new Random().nextInt()), Instant.now().toEpochMilli(),false);
|
||||||
SynchronousReceiver<Integer> idReceiver = new SynchronousReceiver<>();
|
SynchronousReceiver<Integer> idReceiver = new SynchronousReceiver<>();
|
||||||
try {
|
try {
|
||||||
requestor.postObject(testList, idReceiver, idReceiver);
|
requestor.postObject(testList, idReceiver, idReceiver);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user