The EntitySpaces Community

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

Tables without primary keys ...

Last post 12-04-2007, 4:47 AM by David.Parsons. 3 replies.
Sort Posts: Previous Next
  •  12-03-2007, 5:27 PM 6968

    Tables without primary keys ...

    Can you add a feature or is there one to generate without the LoadByPrimaryKey method so that tables without such keys don't generate bad code? I have some tables for a client that just don't need keys (don't ask) .... and they won't add them.

     

    thanks

    -c 

  •  12-03-2007, 5:43 PM 6971 in reply to 6968

    Re: Tables without primary keys ...

    We will add this to our Trac system, we would need to overload the Save() and throw an exception as calling Delete could be disastrous. We can talk about this on our team meeting this week.  I think you can get it to work if you just comment out totally the LoadByPrimaryKey() methods after they are generated. But please don't try to delete or save any data through it.

    EntitySpaces | Twitter | BLOG | Please honor our Software License
  •  12-03-2007, 5:54 PM 6972 in reply to 6971

    Re: Tables without primary keys ...

    Great - I think performance is a reason they get left off some tables - i.e. you're storing a ton of data but seldom read it so you want super fast writes... I think no keys helps.

    -c
     

  •  12-04-2007, 4:47 AM 6977 in reply to 6972

    Re: Tables without primary keys ...

    Could you create a View for each of those tables that just did a 'SELECT * FROM NoPkTable', not select the tables during table generation, and do a separate generation for the Views? That gets you the properties and Query.Load capabilities, without the dangers associated with generating from tables that lack a primary key.
    David Neal Parsons
    www.entityspaces.net
View as RSS news feed in XML