Welcome Guest, Not a member yet? Register   Sign In
New Simple Code Generation
#26

[eluser]lifewithryan[/eluser]
I didn't build in any "magic" for handling relationships. But what you'd do is something like this (consider a blog):


In /config/Blog
table:blogs
field:id:BIGINT:notNull:pk
...more blog fields...

Now every blog should have comments, and comments would have a foreign key back to the blog in which they relate, so in /config/Comment:
table:comments
field:blog_id:BIGINT:notNull

I don't have an "fk" association in the ignition script, I just handle that in my code. When someone submits a comment, I know i have to have the "id" of the blog and set comment->blog_id = blog.id, etc.

Make sense? With ignition, I didn't want to really create TOO much ORM type stuff. A) I'm not that ambitious and B) I didn't want to paint anyone into a corner into doing things "my way" so to speak. (Granted, I sort of am doing that with the code I generate, but those are easy changes. Either change it after the fact --OR-- modify the templates to generate different code.


Hope that helps.


Messages In This Thread
New Simple Code Generation - by El Forum - 01-11-2008, 12:38 PM
New Simple Code Generation - by El Forum - 01-11-2008, 04:32 PM
New Simple Code Generation - by El Forum - 01-11-2008, 06:49 PM
New Simple Code Generation - by El Forum - 01-11-2008, 07:54 PM
New Simple Code Generation - by El Forum - 01-12-2008, 09:51 AM
New Simple Code Generation - by El Forum - 01-12-2008, 10:39 AM
New Simple Code Generation - by El Forum - 01-12-2008, 11:34 AM
New Simple Code Generation - by El Forum - 01-15-2008, 04:06 PM
New Simple Code Generation - by El Forum - 01-15-2008, 04:43 PM
New Simple Code Generation - by El Forum - 01-15-2008, 05:00 PM
New Simple Code Generation - by El Forum - 01-16-2008, 09:00 AM
New Simple Code Generation - by El Forum - 01-16-2008, 09:20 AM
New Simple Code Generation - by El Forum - 01-28-2008, 03:56 PM
New Simple Code Generation - by El Forum - 01-29-2008, 08:26 AM
New Simple Code Generation - by El Forum - 01-29-2008, 09:33 AM
New Simple Code Generation - by El Forum - 02-03-2008, 02:52 PM
New Simple Code Generation - by El Forum - 09-23-2008, 05:09 PM
New Simple Code Generation - by El Forum - 09-23-2008, 08:29 PM
New Simple Code Generation - by El Forum - 09-23-2008, 09:08 PM
New Simple Code Generation - by El Forum - 09-24-2008, 07:24 AM
New Simple Code Generation - by El Forum - 09-24-2008, 08:20 AM
New Simple Code Generation - by El Forum - 09-24-2008, 02:28 PM
New Simple Code Generation - by El Forum - 09-24-2008, 04:18 PM
New Simple Code Generation - by El Forum - 09-24-2008, 07:19 PM
New Simple Code Generation - by El Forum - 09-24-2008, 08:50 PM
New Simple Code Generation - by El Forum - 09-25-2008, 07:37 AM
New Simple Code Generation - by El Forum - 09-25-2008, 03:59 PM
New Simple Code Generation - by El Forum - 09-26-2008, 07:32 AM
New Simple Code Generation - by El Forum - 09-26-2008, 08:04 AM
New Simple Code Generation - by El Forum - 09-29-2008, 06:23 AM
New Simple Code Generation - by El Forum - 09-29-2008, 07:29 AM
New Simple Code Generation - by El Forum - 09-29-2008, 07:56 AM
New Simple Code Generation - by El Forum - 09-29-2008, 09:12 AM
New Simple Code Generation - by El Forum - 09-29-2008, 02:02 PM
New Simple Code Generation - by El Forum - 09-29-2008, 02:08 PM



Theme © iAndrew 2016 - Forum software by © MyBB