summaryrefslogtreecommitdiff
path: root/src/database
AgeCommit message (Collapse)AuthorFilesLines
2014-05-10user: Add verified, description, fix coordinates typePeter Wu2-2/+11
2014-05-10Fix timestamp typePeter Wu2-7/+10
Without this cast, setTimestamp would complain that a timestamp is expected, but a text type is given.
2014-05-10Convert String to DateTime (for created_at)Peter Wu2-2/+14
Extra efforts are done to keep the timezone information.
2014-05-10More query fixes (incorrect field names, table alias)Peter Wu2-4/+4
2014-05-10Split url to tweetUrl and userUrl, misc fixesPeter Wu2-21/+15
* Insert User URLs. * Fix hash insertion query (copy/paste error...). * Split url to tweetUrl and userUrl as there is no "url" table anymore. * Do not execute queries directly via getStmt(), but execute them via NamedPreparedStatement such that faulty queries can be printed. * Fix buildQuery for more than two primary keys. * Drop comments from prepared statements members in DataFiller, there is nothing that you cannot learn from the variable name. Besides there was a copy/paste error for mentions. * Change order of insertion to ensure consistency. * Inline setting parameters for queries, it is now more transparant.
2014-05-10NamedPreparedStatement: fix query parametersPeter Wu1-3/+3
2014-05-10Coordinates is an object with an arrayPeter Wu1-1/+7
Ensure that the array is of a fixed length, add tests to check for that.
2014-05-09Entities can be missing, user.place is not a stringPeter Wu1-1/+5
* User: place is not a string but a Place object. * User: entities is nullable. * Tweet: in_reply_to_user_id, coordinates is nullable. * ValidatingJsonDeserializer: Treat null values as missing fields. * ValidatingJsonDeserializerTest: Test for null values.
2014-05-09Use upsert queries, convert to named parameter statementsPeter Wu2-82/+170
Get rid of ispostedby, move it to tweet table ("userid")
2014-05-09Get rid of useless methodPeter Wu1-49/+37
2014-05-09Get rid of DBConnectionPeter Wu2-59/+65
That construct was hiding the Connection instance. Very bad abstraction as I really need it to support transactions. While at it, make the prepared statement objects final such that it is detected when those are not properly initialized. In Main, use try-with-resources, remove a noisy "exit succesfull" [sic] message. Due to the extra try/catch for the db connection (RuntimeException is not OK my friend!), the indentation had to be changed.
2014-05-08Get rid of unused crapPeter Wu1-173/+0
2014-05-08Replace JSON by GSON, adding extra validationsPeter Wu1-58/+59
Also change reader method, tweets are not received via an observed but by submitting from the caller. Added TODO WTF here and there, formatted with Alt + Shift + F.
2014-05-07data querries into databaseS1297781-13/+103
2014-05-07Removed the extranous DBQuery and simpel propertyMaurice Laveaux3-50/+45
* InputReader reads from Scanner.
2014-05-07Added classes to refactor the database code.Maurice Laveaux4-0/+285
* DBConnection creates a persistent conn. * DBQuery resolves and executes queries. * QueryUtils creates sql query text.