Re: Help wanted: instantiating tables from templates

Chuck Hill <[email protected]>
Newsgroups gmane.comp.web.webobjects.eof
Message-ID <[email protected]>
Hi Michael,

First off I think you mean encode the Entity not the table in the primary
key.  It is Obj-C, but one solution is here:
http://www.omnigroup.com/mailman/archive/eof/2000-July/000664.html
Of course, each Entity will know its table so the end result is much the same.

Second, are you really sure this is a good idea?  It seems awfully
complicated and difficult to maintain.  You are going to need to be able to
create tables on the fly and also alter your EOModel on the fly to add new
entities.  This sounds like pushing EOF to its limits and when you do that
I've often found that it gets, hmmmm, grumpy.  ;-)  I think I'd look at
having some more FKs in the rows that identify what is what.

HTH

Chuck


At 01:52 PM 10/02/2003 -0600, Michael Gersten wrote:
>I want to instantiate new tables/entities from template tables. I don't
know how.
>
>Specifically, I want to have an entity that looks like an accounting
general ledger table. Right now I'm looking at a pair of tables, a standard
master/detail listing. One table is a list of the individual lines
affecting the accounts, with a foreign transaction PK; the other contains
the transactions.
>
>What I want to do, however, is to have all of the information for
different accounts located in different database tables.
>
>And, since any transaction will reference transactions in another table,
that means that I'm going to need to identify by (foreign) PK both the
table and the transaction in that table (To indicate both a debit from one
account, and a credit to the other).
>
>I know that there was prior discussion where someone said they were going
to write up generalized "encoding table in PK" code for use, but I never
saw any "It's done, get it here" message.
>
>So, two (or three) questions:
>1. Was any generalized "encode table in PK" support code done and
released? If not, can someone give me a URL for the "Here's the details on
how to do it, but you'll need to customize it for your application" page,
>
>2. Given an entity that lists "transaction #X has entries in these tables"
(one to many), and a template for the detail tables, how do I instantiate
that detail table for Postage, Bank, Rent, PayrollLiabilities, etc., and
add new tables at runtime (including creating new tables at the user's
request),
>
>3. The goal of this is, that by seperating out the individual accounts
into seperate tables, a single table could be used as an account by
different sets of books -- say an individual with two schedule C
businesses, and a personal set of books, will have three different sets of
books that are accessing the same bank account (just as one example -- two
that have owner's draws going out as an expense, and the third that has it
as an assent account.) Can anyone think of a better idea for organizing this?
>
>-- 
>I am a Mac OS X-Cocoa/WOF/EOF developer as well as a C++/Java/General OO
developer/Rdbm developer, and I'm available for hire. Please contact me at
michael-job-sig12-15-2002 @ stb.nccom.com if interested.
>
>-- Help rate sound codecs! Visit http://www.soundexpert.info
>_______________________________________________
>EOF mailing list
>[email protected]
>http://www.omnigroup.com/mailman/listinfo/eof
>

--

Chuck Hill                                 [email protected]
Global Village Consulting Inc.             http://www.global-village.net
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.