Skip to content

Commit

Permalink
Merge pull request #245 from stevevg/master
Browse files Browse the repository at this point in the history
ChildRelationship -> Schema.ChildRelationship
  • Loading branch information
daveespo committed Jan 23, 2020
2 parents 70169af + f5c91b7 commit fcc533e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions fflib/src/classes/fflib_QueryFactory.cls
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ public class fflib_QueryFactory { //No explicit sharing declaration - inherit fr
* @param assertIsAccessible indicates whether to check if the user has access to the subquery object
**/
public fflib_QueryFactory subselectQuery(String relationshipName, Boolean assertIsAccessible){
ChildRelationship relationship = getChildRelationship(relationshipName);
Schema.ChildRelationship relationship = getChildRelationship(relationshipName);
if (relationship != null) {
return setSubselectQuery(relationship, assertIsAccessible);
}
Expand All @@ -416,7 +416,7 @@ public class fflib_QueryFactory { //No explicit sharing declaration - inherit fr
* @exception InvalidSubqueryRelationshipException If this method is called on a subselectQuery or with an invalid relationship
* @param relationship The ChildRelationship to be added as a subquery
**/
public fflib_QueryFactory subselectQuery(ChildRelationship relationship){
public fflib_QueryFactory subselectQuery(Schema.ChildRelationship relationship){
return subselectQuery(relationship, false);
}

Expand All @@ -427,7 +427,7 @@ public class fflib_QueryFactory { //No explicit sharing declaration - inherit fr
* @param relationship The ChildRelationship to be added as a subquery
* @param assertIsAccessible indicates whether to check if the user has access to the subquery object
**/
public fflib_QueryFactory subselectQuery(ChildRelationship relationship, Boolean assertIsAccessible){
public fflib_QueryFactory subselectQuery(Schema.ChildRelationship relationship, Boolean assertIsAccessible){
return setSubselectQuery(relationship, assertIsAccessible);
}

Expand All @@ -437,12 +437,12 @@ public class fflib_QueryFactory { //No explicit sharing declaration - inherit fr
* @exception InvalidSubqueryRelationshipException If this method is called on a subselectQuery or with an invalid relationship
* @param relationship The ChildRelationship to be added as a subquery
**/
private fflib_QueryFactory setSubselectQuery(ChildRelationship relationship, Boolean assertIsAccessible){
private fflib_QueryFactory setSubselectQuery(Schema.ChildRelationship relationship, Boolean assertIsAccessible){
if (this.relationship != null){
throw new InvalidSubqueryRelationshipException('Invalid call to subselectQuery. You may not add a subselect query to a subselect query.');
}
if (this.subselectQueryMap == null){
this.subselectQueryMap = new Map<ChildRelationship, fflib_QueryFactory>();
this.subselectQueryMap = new Map<Schema.ChildRelationship, fflib_QueryFactory>();
}
if (this.subselectQueryMap.containsKey(relationship)){
return subselectQueryMap.get(relationship);
Expand Down
2 changes: 1 addition & 1 deletion fflib/src/classes/fflib_QueryFactoryTest.cls
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ private class fflib_QueryFactoryTest {
qf.setCondition( 'name like \'%test%\'' );
qf.addOrdering( new fflib_QueryFactory.Ordering('Contact','name',fflib_QueryFactory.SortOrder.ASCENDING) ).addOrdering('CreatedBy.Name',fflib_QueryFactory.SortOrder.DESCENDING);
Schema.DescribeSObjectResult descResult = Contact.SObjectType.getDescribe();
ChildRelationship relationship;
Schema.ChildRelationship relationship;
for (Schema.ChildRelationship childRow : descResult.getChildRelationships()) {
if (childRow.getRelationshipName() == 'Tasks') {
relationship = childRow;
Expand Down

0 comments on commit fcc533e

Please sign in to comment.