The EntitySpaces Community

Share and learn about the EntitySpaces Architecture.
Welcome to The EntitySpaces Community Sign in | Join | Help
in
Home Forums Photos

Is there a means to manually define foreign key relationships?

Last post 03-26-2008, 4:57 AM by Scott.Schecter. 4 replies.
Sort Posts: Previous Next
  •  03-25-2008, 1:30 PM 8547

    Is there a means to manually define foreign key relationships?

    I'm stuck using a business application with a rather outdated database - although tables have primary keys, foreign keys are few and far between. Changing this schema is not an option, unfortunately. I would like to know if there is any way to manually define a relationship, perhaps in xml, so that I can generate a nice entity model that understands those relationships. I've scoured the forums and google with no success. Thanks in advance.
  •  03-25-2008, 4:16 PM 8549 in reply to 8547

    Re: Is there a means to manually define foreign key relationships?

    Our templates rely on the database schema to generate hierarchical properties. But, you can use DynamicQuery Joins for loading. You're Saves would have to save related tables within a transaction. You would not be able to take advantage of EntitySpaces ability to do downstream saves automatically.
    David Neal Parsons
    www.entityspaces.net
  •  03-25-2008, 5:37 PM 8551 in reply to 8547

    Re: Is there a means to manually define foreign key relationships?

    Just an idea but would it be possible for you to create a separate development version of the DB and create the relationships you need in this development DB - then generate against that - then you can have the relationships reflected in EntitySpaces as you want and you can use this generated code against your 'live' database accordingly?

    Hope that helps

    Martin

  •  03-25-2008, 7:49 PM 8552 in reply to 8551

    Re: Is there a means to manually define foreign key relationships?

    Just so you know. The ability to do what you're asking (Database Modeling using XML is an important feature we hope to add to EntitySpaces in the fall release).

    EntitySpaces | Twitter | BLOG | Please honor our Software License
  •  03-26-2008, 4:57 AM 8562 in reply to 8552

    Re: Is there a means to manually define foreign key relationships?

    Really you need a domain object to model like you are requesting. As Mike said this is on our radar, and something we will be adding. Another simple workaround might be to create some views for the instance where you need to add the relations. Our Dynamic Query API joins are another.

    Regards,

    Scott Schecter
    EntitySpaces | My Site
View as RSS news feed in XML