Prev | Current Page 576 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"

request( ???INSERT INTO Lookup (
int_author, int_chapter ) VALUES (
1, 2 )??? );
cnx.close();
}
}
This new table stores references to records from both tables, mapping each author to one or more
chapters and possibly each chapter to one or more authors. As you can see, once the table is created, it ??™ s
populated with a couple of records, so that you have something to test with.
Next, you need to rewrite the Author table to facilitate the storage of a list of Chapter objects:
class Author extends neko.db.Object
{
public var int_id : Int;
public var var_username : String;
public var var_password : String;
public var var_email : String;
public var dte_added : Date;
public var int_chapter_id : Int; // Now deprecated
public var chapters : List < Chapter > ;
static var PRIVATE_FIELDS = [???chapters???];
static var TABLE_NAME = ???Author???;
static var TABLE_IDS = [???int_id???];
public static var manager = new AuthorManager();
}
As you can see, the int_chapter_id will now be deprecated. This is because the Lookup table will now
facilitate all references to an author ??™ s chapter records.


Pages:
564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588