I’m trying to understand relational database data retrieval with Backendless. I was wondering if there are any video tutorials explaining this topic further?
Does Backendless have a “Create View” option where I can summarise data then call it?
I have 5 levels of relational tables. All which have 1 to Many relationship. Just trying to display the data at the lowest level i.e. CourseCategory is, well, challenging.
Pilot
Enrolment
- Course
- CourseCategory
- Competency
Perhaps, I’m overthinking this, but its how I have done in for numerous other languages. Just getting myself a tad confused.
It sounds like you’re overthinking it. Try to approach it from the user experience perspective. It is rarely the UI needs to have ALL of the data at once.
Btw, views in the classical SQL sense are not supported.
Yeah I thought was the case, the issue is I really do need to keep some form of relationships…fortunantly its at the very beginning so might look at a different way of doing this and move away from relationships.
I actually got it working. I found that the details were buried in array’s. It also helps when you import the corresponding tables oops. However, need a little advise on how to extract the value from the nsmutablearry.
Happy to shot this over to stack overflow, but thought I would ask here first hope that is okay.
Below is my code that where i’m extracting information from backendless.
BackendlessDataQuery *query = [BackendlessDataQuery query];
query.whereClause = [NSString stringWithFormat:@"PilotFirstName LIKE \'%%%@%%\'", partialName];
BackendlessCollection *collection = [backendless.persistenceService find:[Pilot class] dataQuery:query];
NSLog(@"Results From Query %@",collection);
if (collection.data.count == 0) {
//reset the NSArray to be blank because no values came back
studentRecordData = [[NSMutableArray alloc]initWithArray:collection.data];
}
else
{
studentRecordData = [[NSMutableArray alloc]init];
for (Pilot *pilotLog in collection.data)
{
pilotFirstName = pilotLog.PilotFirstName;
pilotLastName = pilotLog.PilotLastName;
contactNumber = pilotLog.ContactNumber;
ARN = pilotLog.ARN;
RAA = pilotLog.RAANumber;
StudentObjectId = pilotLog.objectId;
StudentEnrolment = [[[collection.data valueForKey:@"Enrolment"]valueForKey:@"Course"]valueForKey:@"CourseName"];
NSLog (@"R: %@", [[[collection.data valueForKey:@"Enrolment"]valueForKey:@"Course"]valueForKey:@"CourseName"]);
Helping you to build your application is not a free support option, according to our Support Policy.
In case you find a bug in SDK or on the server, please feel free to report it.
Hi Sergey,
I wasn’t after free support as I’m still trying to understand how Backendless works coming from Parse. But I can see how I asked the question how it may have been conceived. I’ll be careful how I ask the questions and keep it in line with the Support Policy. Furthermore, any questions that are in objective C nature outside of the scope of backendless, I’ll post on other forums. All good.
I actually worked out the issue afterwards based on marks comments. I posted what I had in the event anyone else was having the same issue.