{"action":"created","comment":{"url":"https://api.github.com/repos/eduardb/ClujBike/pulls/comments/91089543","pull_request_review_id":11592153,"id":91089543,"diff_hunk":"@@ -0,0 +1,93 @@\n+package com.deveddy.clujbike.data.repository;\n+\n+import android.content.ContentValues;\n+import android.database.Cursor;\n+import android.database.sqlite.SQLiteDatabase;\n+\n+import com.deveddy.clujbike.data.repository.SqlDataBaseContract.Station;\n+import com.deveddy.clujbike.data.repository.mapper.DataMapper;\n+import com.deveddy.clujbike.data.repository.models.StationEntity;\n+import com.deveddy.clujbike.data.repository.specifications.Specification;\n+import com.deveddy.clujbike.data.repository.specifications.SqlSpecification;\n+\n+import rx.Completable;\n+import rx.Observable;\n+\n+public class StationSqlRepository implements Repository<StationEntity> {\n+\n+    static final String STATION_TABLE_NAME = Station.TABLE_NAME;\n+\n+    private final DatabaseHelper databaseHelper;\n+    private final DataMapper<StationEntity, ContentValues> contentValueDataMapper;\n+    private final DataMapper<Cursor, StationEntity> cursorDataMapper;\n+\n+    public StationSqlRepository(DatabaseHelper databaseHelper,\n+                                DataMapper<StationEntity, ContentValues> contentValueDataMapper,\n+                                DataMapper<Cursor, StationEntity> cursorDataMapper) {\n+        this.databaseHelper = databaseHelper;\n+\n+        this.contentValueDataMapper = contentValueDataMapper;\n+        this.cursorDataMapper = cursorDataMapper;\n+    }\n+\n+    private void closeTransactionWithoutSuccess(SQLiteDatabase db) {","path":"app/src/main/java/com/deveddy/clujbike/data/repository/StationSqlRepository.java","position":32,"original_position":33,"commit_id":"50cf189d0c1042ea8c9ae33fdeecf1708e1bd79c","original_commit_id":"3da74cdf935ae06843fc6858ddc85e1493a2ad05","user":{"login":"eduardb","id":2426348,"avatar_url":"https://avatars.githubusercontent.com/u/2426348?v=3","gravatar_id":"","url":"https://api.github.com/users/eduardb","html_url":"https://github.com/eduardb","followers_url":"https://api.github.com/users/eduardb/followers","following_url":"https://api.github.com/users/eduardb/following{/other_user}","gists_url":"https://api.github.com/users/eduardb/gists{/gist_id}","starred_url":"https://api.github.com/users/eduardb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eduardb/subscriptions","organizations_url":"https://api.github.com/users/eduardb/orgs","repos_url":"https://api.github.com/users/eduardb/repos","events_url":"https://api.github.com/users/eduardb/events{/privacy}","received_events_url":"https://api.github.com/users/eduardb/received_events","type":"User","site_admin":false},"body":"bump","created_at":"2016-12-06T14:37:55Z","updated_at":"2016-12-06T14:43:50Z","html_url":"https://github.com/eduardb/ClujBike/pull/2#discussion_r91089543","pull_request_url":"https://api.github.com/repos/eduardb/ClujBike/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/eduardb/ClujBike/pulls/comments/91089543"},"html":{"href":"https://github.com/eduardb/ClujBike/pull/2#discussion_r91089543"},"pull_request":{"href":"https://api.github.com/repos/eduardb/ClujBike/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/eduardb/ClujBike/pulls/2","id":95726381,"html_url":"https://github.com/eduardb/ClujBike/pull/2","diff_url":"https://github.com/eduardb/ClujBike/pull/2.diff","patch_url":"https://github.com/eduardb/ClujBike/pull/2.patch","issue_url":"https://api.github.com/repos/eduardb/ClujBike/issues/2","number":2,"state":"open","locked":false,"title":"Repository pattern applied for the persistence layer","user":{"login":"RoxanaTanaselea","id":4051309,"avatar_url":"https://avatars.githubusercontent.com/u/4051309?v=3","gravatar_id":"","url":"https://api.github.com/users/RoxanaTanaselea","html_url":"https://github.com/RoxanaTanaselea","followers_url":"https://api.github.com/users/RoxanaTanaselea/followers","following_url":"https://api.github.com/users/RoxanaTanaselea/following{/other_user}","gists_url":"https://api.github.com/users/RoxanaTanaselea/gists{/gist_id}","starred_url":"https://api.github.com/users/RoxanaTanaselea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RoxanaTanaselea/subscriptions","organizations_url":"https://api.github.com/users/RoxanaTanaselea/orgs","repos_url":"https://api.github.com/users/RoxanaTanaselea/repos","events_url":"https://api.github.com/users/RoxanaTanaselea/events{/privacy}","received_events_url":"https://api.github.com/users/RoxanaTanaselea/received_events","type":"User","site_admin":false},"body":"I implemented the repository pattern for the persistence layer. The purpose is to have a clean separation between the domain layer and the persistence layer and to make the data origin transparent to the client. \"Client objects construct query specifications declaratively and submit them to Repository for satisfaction. Objects can be added to and removed from the Repository, as they can from a simple collection of objects, and the mapping code encapsulated by the Repository will carry out the appropriate operations behind the scenes\" (Martin Fowler)\r\nThe way I did it :\r\nI defined the Repository Pattern for Station entity\r\nI implemented a basic Repository with Sqlite \r\nI used a data mapper layer to isolate domain objects from details of the database access code\r\nI did Unit Tests for Sqlite repository implentation\r\n","created_at":"2016-11-29T16:27:58Z","updated_at":"2016-12-06T14:43:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3b0cffdc52a4dca836fe3dfe15bb77dbece7fe16","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/eduardb/ClujBike/pulls/2/commits","review_comments_url":"https://api.github.com/repos/eduardb/ClujBike/pulls/2/comments","review_comment_url":"https://api.github.com/repos/eduardb/ClujBike/pulls/comments{/number}","comments_url":"https://api.github.com/repos/eduardb/ClujBike/issues/2/comments","statuses_url":"https://api.github.com/repos/eduardb/ClujBike/statuses/50cf189d0c1042ea8c9ae33fdeecf1708e1bd79c","head":{"label":"RoxanaTanaselea:rt_repository","ref":"rt_repository","sha":"50cf189d0c1042ea8c9ae33fdeecf1708e1bd79c","user":{"login":"RoxanaTanaselea","id":4051309,"avatar_url":"https://avatars.githubusercontent.com/u/4051309?v=3","gravatar_id":"","url":"https://api.github.com/users/RoxanaTanaselea","html_url":"https://github.com/RoxanaTanaselea","followers_url":"https://api.github.com/users/RoxanaTanaselea/followers","following_url":"https://api.github.com/users/RoxanaTanaselea/following{/other_user}","gists_url":"https://api.github.com/users/RoxanaTanaselea/gists{/gist_id}","starred_url":"https://api.github.com/users/RoxanaTanaselea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RoxanaTanaselea/subscriptions","organizations_url":"https://api.github.com/users/RoxanaTanaselea/orgs","repos_url":"https://api.github.com/users/RoxanaTanaselea/repos","events_url":"https://api.github.com/users/RoxanaTanaselea/events{/privacy}","received_events_url":"https://api.github.com/users/RoxanaTanaselea/received_events","type":"User","site_admin":false},"repo":{"id":69794953,"name":"ClujBike","full_name":"RoxanaTanaselea/ClujBike","owner":{"login":"RoxanaTanaselea","id":4051309,"avatar_url":"https://avatars.githubusercontent.com/u/4051309?v=3","gravatar_id":"","url":"https://api.github.com/users/RoxanaTanaselea","html_url":"https://github.com/RoxanaTanaselea","followers_url":"https://api.github.com/users/RoxanaTanaselea/followers","following_url":"https://api.github.com/users/RoxanaTanaselea/following{/other_user}","gists_url":"https://api.github.com/users/RoxanaTanaselea/gists{/gist_id}","starred_url":"https://api.github.com/users/RoxanaTanaselea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RoxanaTanaselea/subscriptions","organizations_url":"https://api.github.com/users/RoxanaTanaselea/orgs","repos_url":"https://api.github.com/users/RoxanaTanaselea/repos","events_url":"https://api.github.com/users/RoxanaTanaselea/events{/privacy}","received_events_url":"https://api.github.com/users/RoxanaTanaselea/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/RoxanaTanaselea/ClujBike","description":"Open source app for the self-service stations network for bicycle renting in Cluj-Napoca","fork":true,"url":"https://api.github.com/repos/RoxanaTanaselea/ClujBike","forks_url":"https://api.github.com/repos/RoxanaTanaselea/ClujBike/forks","keys_url":"https://api.github.com/repos/RoxanaTanaselea/ClujBike/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RoxanaTanaselea/ClujBike/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RoxanaTanaselea/ClujBike/teams","hooks_url":"https://api.github.com/repos/RoxanaTanaselea/ClujBike/hooks","issue_events_url":"https://api.github.com/repos/RoxanaTanaselea/ClujBike/issues/events{/number}","events_url":"https://api.github.com/repos/RoxanaTanaselea/ClujBike/events","assignees_url":"https://api.github.com/repos/RoxanaTanaselea/ClujBike/assignees{/user}","branches_url":"https://api.github.com/repos/RoxanaTanaselea/ClujBike/branches{/branch}","tags_url":"https://api.github.com/repos/RoxanaTanaselea/ClujBike/tags","blobs_url":"https://api.github.com/repos/RoxanaTanaselea/ClujBike/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RoxanaTanaselea/ClujBike/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RoxanaTanaselea/ClujBike/git/refs{/sha}","trees_url":"https://api.github.com/repos/RoxanaTanaselea/ClujBike/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RoxanaTanaselea/ClujBike/statuses/{sha}","languages_url":"https://api.github.com/repos/RoxanaTanaselea/ClujBike/languages","stargazers_url":"https://api.github.com/repos/RoxanaTanaselea/ClujBike/stargazers","contributors_url":"https://api.github.com/repos/RoxanaTanaselea/ClujBike/contributors","subscribers_url":"https://api.github.com/repos/RoxanaTanaselea/ClujBike/subscribers","subscription_url":"https://api.github.com/repos/RoxanaTanaselea/ClujBike/subscription","commits_url":"https://api.github.com/repos/RoxanaTanaselea/ClujBike/commits{/sha}","git_commits_url":"https://api.github.com/repos/RoxanaTanaselea/ClujBike/git/commits{/sha}","comments_url":"https://api.github.com/repos/RoxanaTanaselea/ClujBike/comments{/number}","issue_comment_url":"https://api.github.com/repos/RoxanaTanaselea/ClujBike/issues/comments{/number}","contents_url":"https://api.github.com/repos/RoxanaTanaselea/ClujBike/contents/{+path}","compare_url":"https://api.github.com/repos/RoxanaTanaselea/ClujBike/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RoxanaTanaselea/ClujBike/merges","archive_url":"https://api.github.com/repos/RoxanaTanaselea/ClujBike/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RoxanaTanaselea/ClujBike/downloads","issues_url":"https://api.github.com/repos/RoxanaTanaselea/ClujBike/issues{/number}","pulls_url":"https://api.github.com/repos/RoxanaTanaselea/ClujBike/pulls{/number}","milestones_url":"https://api.github.com/repos/RoxanaTanaselea/ClujBike/milestones{/number}","notifications_url":"https://api.github.com/repos/RoxanaTanaselea/ClujBike/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RoxanaTanaselea/ClujBike/labels{/name}","releases_url":"https://api.github.com/repos/RoxanaTanaselea/ClujBike/releases{/id}","deployments_url":"https://api.github.com/repos/RoxanaTanaselea/ClujBike/deployments","created_at":"2016-10-02T12:02:38Z","updated_at":"2016-10-02T12:02:39Z","pushed_at":"2016-12-06T13:41:13Z","git_url":"git://github.com/RoxanaTanaselea/ClujBike.git","ssh_url":"git@github.com:RoxanaTanaselea/ClujBike.git","clone_url":"https://github.com/RoxanaTanaselea/ClujBike.git","svn_url":"https://github.com/RoxanaTanaselea/ClujBike","homepage":null,"size":145,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"eduardb:master","ref":"master","sha":"b9f8b88a41a46fa2b6294f86aed41a5886f390cf","user":{"login":"eduardb","id":2426348,"avatar_url":"https://avatars.githubusercontent.com/u/2426348?v=3","gravatar_id":"","url":"https://api.github.com/users/eduardb","html_url":"https://github.com/eduardb","followers_url":"https://api.github.com/users/eduardb/followers","following_url":"https://api.github.com/users/eduardb/following{/other_user}","gists_url":"https://api.github.com/users/eduardb/gists{/gist_id}","starred_url":"https://api.github.com/users/eduardb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eduardb/subscriptions","organizations_url":"https://api.github.com/users/eduardb/orgs","repos_url":"https://api.github.com/users/eduardb/repos","events_url":"https://api.github.com/users/eduardb/events{/privacy}","received_events_url":"https://api.github.com/users/eduardb/received_events","type":"User","site_admin":false},"repo":{"id":53246344,"name":"ClujBike","full_name":"eduardb/ClujBike","owner":{"login":"eduardb","id":2426348,"avatar_url":"https://avatars.githubusercontent.com/u/2426348?v=3","gravatar_id":"","url":"https://api.github.com/users/eduardb","html_url":"https://github.com/eduardb","followers_url":"https://api.github.com/users/eduardb/followers","following_url":"https://api.github.com/users/eduardb/following{/other_user}","gists_url":"https://api.github.com/users/eduardb/gists{/gist_id}","starred_url":"https://api.github.com/users/eduardb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eduardb/subscriptions","organizations_url":"https://api.github.com/users/eduardb/orgs","repos_url":"https://api.github.com/users/eduardb/repos","events_url":"https://api.github.com/users/eduardb/events{/privacy}","received_events_url":"https://api.github.com/users/eduardb/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/eduardb/ClujBike","description":"Open source app for the self-service stations network for bicycle renting in Cluj-Napoca","fork":false,"url":"https://api.github.com/repos/eduardb/ClujBike","forks_url":"https://api.github.com/repos/eduardb/ClujBike/forks","keys_url":"https://api.github.com/repos/eduardb/ClujBike/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eduardb/ClujBike/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eduardb/ClujBike/teams","hooks_url":"https://api.github.com/repos/eduardb/ClujBike/hooks","issue_events_url":"https://api.github.com/repos/eduardb/ClujBike/issues/events{/number}","events_url":"https://api.github.com/repos/eduardb/ClujBike/events","assignees_url":"https://api.github.com/repos/eduardb/ClujBike/assignees{/user}","branches_url":"https://api.github.com/repos/eduardb/ClujBike/branches{/branch}","tags_url":"https://api.github.com/repos/eduardb/ClujBike/tags","blobs_url":"https://api.github.com/repos/eduardb/ClujBike/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eduardb/ClujBike/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eduardb/ClujBike/git/refs{/sha}","trees_url":"https://api.github.com/repos/eduardb/ClujBike/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eduardb/ClujBike/statuses/{sha}","languages_url":"https://api.github.com/repos/eduardb/ClujBike/languages","stargazers_url":"https://api.github.com/repos/eduardb/ClujBike/stargazers","contributors_url":"https://api.github.com/repos/eduardb/ClujBike/contributors","subscribers_url":"https://api.github.com/repos/eduardb/ClujBike/subscribers","subscription_url":"https://api.github.com/repos/eduardb/ClujBike/subscription","commits_url":"https://api.github.com/repos/eduardb/ClujBike/commits{/sha}","git_commits_url":"https://api.github.com/repos/eduardb/ClujBike/git/commits{/sha}","comments_url":"https://api.github.com/repos/eduardb/ClujBike/comments{/number}","issue_comment_url":"https://api.github.com/repos/eduardb/ClujBike/issues/comments{/number}","contents_url":"https://api.github.com/repos/eduardb/ClujBike/contents/{+path}","compare_url":"https://api.github.com/repos/eduardb/ClujBike/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eduardb/ClujBike/merges","archive_url":"https://api.github.com/repos/eduardb/ClujBike/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eduardb/ClujBike/downloads","issues_url":"https://api.github.com/repos/eduardb/ClujBike/issues{/number}","pulls_url":"https://api.github.com/repos/eduardb/ClujBike/pulls{/number}","milestones_url":"https://api.github.com/repos/eduardb/ClujBike/milestones{/number}","notifications_url":"https://api.github.com/repos/eduardb/ClujBike/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eduardb/ClujBike/labels{/name}","releases_url":"https://api.github.com/repos/eduardb/ClujBike/releases{/id}","deployments_url":"https://api.github.com/repos/eduardb/ClujBike/deployments","created_at":"2016-03-06T09:00:54Z","updated_at":"2016-04-19T20:14:25Z","pushed_at":"2016-12-06T13:41:14Z","git_url":"git://github.com/eduardb/ClujBike.git","ssh_url":"git@github.com:eduardb/ClujBike.git","clone_url":"https://github.com/eduardb/ClujBike.git","svn_url":"https://github.com/eduardb/ClujBike","homepage":null,"size":117,"stargazers_count":2,"watchers_count":2,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/eduardb/ClujBike/pulls/2"},"html":{"href":"https://github.com/eduardb/ClujBike/pull/2"},"issue":{"href":"https://api.github.com/repos/eduardb/ClujBike/issues/2"},"comments":{"href":"https://api.github.com/repos/eduardb/ClujBike/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/eduardb/ClujBike/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/eduardb/ClujBike/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/eduardb/ClujBike/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/eduardb/ClujBike/statuses/50cf189d0c1042ea8c9ae33fdeecf1708e1bd79c"}}}}
{"actor":{"display_login":"eduardb"}}