{"action":"created","comment":{"url":"https://api.github.com/repos/patronmanager/fflib-apex-common/pulls/comments/53992305","id":53992305,"diff_hunk":"@@ -206,20 +240,32 @@ public class fflib_QueryFactory { //No explicit sharing declaration - inherit fr\n \t\t\tthrow new InvalidFieldException(null,this.table);\n \t\tif (enforceFLS) \n \t\t\tfflib_SecurityUtils.checkFieldIsReadable(table, field);\n-\t\tfields.add( new QueryField(field) );\n+\t\tthis.fields.add(getQueryFieldFromToken(field));\n \t\treturn this;\n \t}\n+\t\n+\t/**\n+\t * Returns the appropriate QueryField implementation, based on the \"lightweight\" flag\n+\t * @param field the {@link Schema.SObjectField} for the QueryField\n+\t * @returns either a QueryField, or LightweightQueryField object for the specified SObjectField\n+\t**/\n+\tprivate QueryField getQueryFieldFromToken(Schema.SObjectField field) {\n+\t\tQueryField qf;","path":"fflib/src/classes/fflib_QueryFactory.cls","position":145,"original_position":145,"commit_id":"6165233166f431643cbe2bdcb451f41093bfe1bd","original_commit_id":"6165233166f431643cbe2bdcb451f41093bfe1bd","user":{"login":"daveespo","id":233309,"avatar_url":"https://avatars.githubusercontent.com/u/233309?v=3","gravatar_id":"","url":"https://api.github.com/users/daveespo","html_url":"https://github.com/daveespo","followers_url":"https://api.github.com/users/daveespo/followers","following_url":"https://api.github.com/users/daveespo/following{/other_user}","gists_url":"https://api.github.com/users/daveespo/gists{/gist_id}","starred_url":"https://api.github.com/users/daveespo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daveespo/subscriptions","organizations_url":"https://api.github.com/users/daveespo/orgs","repos_url":"https://api.github.com/users/daveespo/repos","events_url":"https://api.github.com/users/daveespo/events{/privacy}","received_events_url":"https://api.github.com/users/daveespo/received_events","type":"User","site_admin":false},"body":"I was taught that too .. but I have now concluded that people in academia don't know how to write code worth a lick :-)\r\n\r\nI like to exit early and minimize indentation .. it makes for readable code that allows your mind to concentrate on the prerequisites that were satisfied before we got to a certain point in the code","created_at":"2016-02-24T19:26:21Z","updated_at":"2016-02-24T19:26:21Z","html_url":"https://github.com/patronmanager/fflib-apex-common/pull/3#discussion_r53992305","pull_request_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/patronmanager/fflib-apex-common/pulls/comments/53992305"},"html":{"href":"https://github.com/patronmanager/fflib-apex-common/pull/3#discussion_r53992305"},"pull_request":{"href":"https://api.github.com/repos/patronmanager/fflib-apex-common/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/patronmanager/fflib-apex-common/pulls/3","id":60406635,"html_url":"https://github.com/patronmanager/fflib-apex-common/pull/3","diff_url":"https://github.com/patronmanager/fflib-apex-common/pull/3.diff","patch_url":"https://github.com/patronmanager/fflib-apex-common/pull/3.patch","issue_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/issues/3","number":3,"state":"open","locked":false,"title":"interim commit of LightweightQueryField implementation. The core func…","user":{"login":"tfuda","id":1032721,"avatar_url":"https://avatars.githubusercontent.com/u/1032721?v=3","gravatar_id":"","url":"https://api.github.com/users/tfuda","html_url":"https://github.com/tfuda","followers_url":"https://api.github.com/users/tfuda/followers","following_url":"https://api.github.com/users/tfuda/following{/other_user}","gists_url":"https://api.github.com/users/tfuda/gists{/gist_id}","starred_url":"https://api.github.com/users/tfuda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tfuda/subscriptions","organizations_url":"https://api.github.com/users/tfuda/orgs","repos_url":"https://api.github.com/users/tfuda/repos","events_url":"https://api.github.com/users/tfuda/events{/privacy}","received_events_url":"https://api.github.com/users/tfuda/received_events","type":"User","site_admin":false},"body":"…tionality is done. This implement some equivalent unit tests for LightweightQueryField.","created_at":"2016-02-23T20:46:11Z","updated_at":"2016-02-24T19:26:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8e146b11e55878f4189129b2b8393dd201010482","assignee":{"login":"daveespo","id":233309,"avatar_url":"https://avatars.githubusercontent.com/u/233309?v=3","gravatar_id":"","url":"https://api.github.com/users/daveespo","html_url":"https://github.com/daveespo","followers_url":"https://api.github.com/users/daveespo/followers","following_url":"https://api.github.com/users/daveespo/following{/other_user}","gists_url":"https://api.github.com/users/daveespo/gists{/gist_id}","starred_url":"https://api.github.com/users/daveespo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daveespo/subscriptions","organizations_url":"https://api.github.com/users/daveespo/orgs","repos_url":"https://api.github.com/users/daveespo/repos","events_url":"https://api.github.com/users/daveespo/events{/privacy}","received_events_url":"https://api.github.com/users/daveespo/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/pulls/3/commits","review_comments_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/pulls/3/comments","review_comment_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/pulls/comments{/number}","comments_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/issues/3/comments","statuses_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/statuses/6165233166f431643cbe2bdcb451f41093bfe1bd","head":{"label":"patronmanager:LightweightQueryField","ref":"LightweightQueryField","sha":"6165233166f431643cbe2bdcb451f41093bfe1bd","user":{"login":"patronmanager","id":4227087,"avatar_url":"https://avatars.githubusercontent.com/u/4227087?v=3","gravatar_id":"","url":"https://api.github.com/users/patronmanager","html_url":"https://github.com/patronmanager","followers_url":"https://api.github.com/users/patronmanager/followers","following_url":"https://api.github.com/users/patronmanager/following{/other_user}","gists_url":"https://api.github.com/users/patronmanager/gists{/gist_id}","starred_url":"https://api.github.com/users/patronmanager/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patronmanager/subscriptions","organizations_url":"https://api.github.com/users/patronmanager/orgs","repos_url":"https://api.github.com/users/patronmanager/repos","events_url":"https://api.github.com/users/patronmanager/events{/privacy}","received_events_url":"https://api.github.com/users/patronmanager/received_events","type":"Organization","site_admin":false},"repo":{"id":22352970,"name":"fflib-apex-common","full_name":"patronmanager/fflib-apex-common","owner":{"login":"patronmanager","id":4227087,"avatar_url":"https://avatars.githubusercontent.com/u/4227087?v=3","gravatar_id":"","url":"https://api.github.com/users/patronmanager","html_url":"https://github.com/patronmanager","followers_url":"https://api.github.com/users/patronmanager/followers","following_url":"https://api.github.com/users/patronmanager/following{/other_user}","gists_url":"https://api.github.com/users/patronmanager/gists{/gist_id}","starred_url":"https://api.github.com/users/patronmanager/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patronmanager/subscriptions","organizations_url":"https://api.github.com/users/patronmanager/orgs","repos_url":"https://api.github.com/users/patronmanager/repos","events_url":"https://api.github.com/users/patronmanager/events{/privacy}","received_events_url":"https://api.github.com/users/patronmanager/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/patronmanager/fflib-apex-common","description":"Common Apex Library supporting Apex Enterprise Patterns and much more!","fork":true,"url":"https://api.github.com/repos/patronmanager/fflib-apex-common","forks_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/forks","keys_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/keys{/key_id}","collaborators_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/teams","hooks_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/hooks","issue_events_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/issues/events{/number}","events_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/events","assignees_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/assignees{/user}","branches_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/branches{/branch}","tags_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/tags","blobs_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/git/refs{/sha}","trees_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/git/trees{/sha}","statuses_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/statuses/{sha}","languages_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/languages","stargazers_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/stargazers","contributors_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/contributors","subscribers_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/subscribers","subscription_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/subscription","commits_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/commits{/sha}","git_commits_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/git/commits{/sha}","comments_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/comments{/number}","issue_comment_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/issues/comments{/number}","contents_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/contents/{+path}","compare_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/compare/{base}...{head}","merges_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/merges","archive_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/downloads","issues_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/issues{/number}","pulls_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/pulls{/number}","milestones_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/milestones{/number}","notifications_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/labels{/name}","releases_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/releases{/id}","deployments_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/deployments","created_at":"2014-07-28T18:21:19Z","updated_at":"2016-02-12T11:50:29Z","pushed_at":"2016-02-24T15:29:31Z","git_url":"git://github.com/patronmanager/fflib-apex-common.git","ssh_url":"git@github.com:patronmanager/fflib-apex-common.git","clone_url":"https://github.com/patronmanager/fflib-apex-common.git","svn_url":"https://github.com/patronmanager/fflib-apex-common","homepage":"","size":354,"stargazers_count":0,"watchers_count":0,"language":"Apex","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"patronmanager:master","ref":"master","sha":"3287d43847830c6079363f6b73b01351bc61f62d","user":{"login":"patronmanager","id":4227087,"avatar_url":"https://avatars.githubusercontent.com/u/4227087?v=3","gravatar_id":"","url":"https://api.github.com/users/patronmanager","html_url":"https://github.com/patronmanager","followers_url":"https://api.github.com/users/patronmanager/followers","following_url":"https://api.github.com/users/patronmanager/following{/other_user}","gists_url":"https://api.github.com/users/patronmanager/gists{/gist_id}","starred_url":"https://api.github.com/users/patronmanager/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patronmanager/subscriptions","organizations_url":"https://api.github.com/users/patronmanager/orgs","repos_url":"https://api.github.com/users/patronmanager/repos","events_url":"https://api.github.com/users/patronmanager/events{/privacy}","received_events_url":"https://api.github.com/users/patronmanager/received_events","type":"Organization","site_admin":false},"repo":{"id":22352970,"name":"fflib-apex-common","full_name":"patronmanager/fflib-apex-common","owner":{"login":"patronmanager","id":4227087,"avatar_url":"https://avatars.githubusercontent.com/u/4227087?v=3","gravatar_id":"","url":"https://api.github.com/users/patronmanager","html_url":"https://github.com/patronmanager","followers_url":"https://api.github.com/users/patronmanager/followers","following_url":"https://api.github.com/users/patronmanager/following{/other_user}","gists_url":"https://api.github.com/users/patronmanager/gists{/gist_id}","starred_url":"https://api.github.com/users/patronmanager/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patronmanager/subscriptions","organizations_url":"https://api.github.com/users/patronmanager/orgs","repos_url":"https://api.github.com/users/patronmanager/repos","events_url":"https://api.github.com/users/patronmanager/events{/privacy}","received_events_url":"https://api.github.com/users/patronmanager/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/patronmanager/fflib-apex-common","description":"Common Apex Library supporting Apex Enterprise Patterns and much more!","fork":true,"url":"https://api.github.com/repos/patronmanager/fflib-apex-common","forks_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/forks","keys_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/keys{/key_id}","collaborators_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/teams","hooks_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/hooks","issue_events_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/issues/events{/number}","events_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/events","assignees_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/assignees{/user}","branches_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/branches{/branch}","tags_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/tags","blobs_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/git/refs{/sha}","trees_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/git/trees{/sha}","statuses_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/statuses/{sha}","languages_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/languages","stargazers_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/stargazers","contributors_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/contributors","subscribers_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/subscribers","subscription_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/subscription","commits_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/commits{/sha}","git_commits_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/git/commits{/sha}","comments_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/comments{/number}","issue_comment_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/issues/comments{/number}","contents_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/contents/{+path}","compare_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/compare/{base}...{head}","merges_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/merges","archive_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/downloads","issues_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/issues{/number}","pulls_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/pulls{/number}","milestones_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/milestones{/number}","notifications_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/labels{/name}","releases_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/releases{/id}","deployments_url":"https://api.github.com/repos/patronmanager/fflib-apex-common/deployments","created_at":"2014-07-28T18:21:19Z","updated_at":"2016-02-12T11:50:29Z","pushed_at":"2016-02-24T15:29:31Z","git_url":"git://github.com/patronmanager/fflib-apex-common.git","ssh_url":"git@github.com:patronmanager/fflib-apex-common.git","clone_url":"https://github.com/patronmanager/fflib-apex-common.git","svn_url":"https://github.com/patronmanager/fflib-apex-common","homepage":"","size":354,"stargazers_count":0,"watchers_count":0,"language":"Apex","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/patronmanager/fflib-apex-common/pulls/3"},"html":{"href":"https://github.com/patronmanager/fflib-apex-common/pull/3"},"issue":{"href":"https://api.github.com/repos/patronmanager/fflib-apex-common/issues/3"},"comments":{"href":"https://api.github.com/repos/patronmanager/fflib-apex-common/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/patronmanager/fflib-apex-common/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/patronmanager/fflib-apex-common/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/patronmanager/fflib-apex-common/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/patronmanager/fflib-apex-common/statuses/6165233166f431643cbe2bdcb451f41093bfe1bd"}}}}