Reputation: 109
I have three SQLite tables Schools
Classes
and Students
. One School
consists of multiple Classes
and each Class
in turn consists of multiple Students
.
On my application (Air for Android), I have some class structure like this
class School { id:uint; name:String; classArray:ArrayList}
class Class { id:uint; name:String; studentArray:ArrayLisy}
class Student { id:uint; name:String}
As the application is targeted at mobile platform, I would like to minimize the number of queries sent as much as possible. I'm new to SQL so at the moment I just loop through every elements, which is quite inefficient. Is there some kind of compound query or special keyword that can help achieve this.
Thanks
Upvotes: 0
Views: 370
Reputation: 1238
The AIR SQL Classes don't parse custom objects, you cant pass it an object and/or special keywords, it only operates on String
s. I would recommend writing .toSQLInsertString()
, toSQLUpdateString()
functions on your data objects to reduce the amount of object inspections, but you will have to loop through collections.
I recommend reading up on Adobe AIR: SQLConnection
Upvotes: 1