문제

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

도움이 되었습니까?

해결책

The AIR SQL Classes don't parse custom objects, you cant pass it an object and/or special keywords, it only operates on Strings. 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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top