Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ChildRelationship -> Schema.ChildRelationship #245

Merged
merged 1 commit into from
Jan 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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