On 10/28/05, Sean Davis <[EMAIL PROTECTED]> wrote: > Would it be possible to design a view class that would "be" a table if the > primary key was defined but otherwise be a generic View class?
The more I think about it, the more trivial the view class seems. I mentioned before that it should die if you try to load() (if the view has no PK) or save() (if the view has no PK or is not updatable). Well, RDBO already does that! All RDBO::View would add is better error messages, and a way for other code to know that something is a view instead of a regular RDBO. After this upcoming release, I'll start playing with it. > And would joins still be possible? I would think so, as the view class would > still know the column names, etc., but you would have to enforce that a join > (in RDBO terms) is to a primary key from another table or view so the join > could only be from and not to, correct? Joins should work, both to and from. The column map (or key map, in the case of a foreign key) determines the join conditions. The PK is not involved unless its columns happen to appear in the column map. The only kinds of relationships that won't be possible without a PK are "... to one" relationships going to the view from another class (since without a PK, there's no way to pick "one" row in the view) -John ------------------------------------------------------- This SF.Net email is sponsored by the JBoss Inc. Get Certified Today * Register for a JBoss Training Course Free Certification Exam for All Training Attendees Through End of 2005 Visit http://www.jboss.com/services/certification for more information _______________________________________________ Rose-db-object mailing list Rose-db-object@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rose-db-object