From: Ian B. <ia...@co...> - 2004-02-17 16:51:58
|
jws...@ra... wrote: > A conceptual difference is that I do not ever intend to create classes for > minor tables. There will be objects for all the major components like > employees and customers, and there will be objects like invoices that have a > master-detail structure that will be exposed from attributes like > 'line_items'. I will not be joining SQLObjects directly. For tables that will have no object representation, a join is probably the best idea -- RelatedJoin (many-to-many) is an example of this. For the one-to-one joins, I'm not really sure what would be best. In a way, it could almost be phrased like having a table named "table1, table2", and appending "table1.id=table2.id" to all your queries. At least, if you never want a distinct object representation of one table vs. the other. Though in that case, the utility of the separate tables is questionable -- is it really one-to-zero-or-one? Well, then the table name is "table1 left join table2 on table1.id=table2.id", with column names that include the table reference -- even easier! All very hackish though. And since you are using Postgres, views are another possibility. I don't much care for them, but they seem like a good fit to what you're doing. Ian |