support for hierarchical tables?

Hello!

Is there an example of a table supporting "hierarchical" rows somewhere. I think of a situation where there's a ROWGUID column as primary key and a ParentROWGUID being a foreign reference to the same table

Do you know if it's correct that there are problems with such structures at the current level of development of LINQ


Best regards,

Henrik Dahl



Answer this question

support for hierarchical tables?

  • Bourne Again

    Hello!

    Do you know if DLINQ works without giving any strange exceptions when you try to remove all rows in one shot, i.e. p in Source select p and pass it to db.Source.RemoveAll

    (It may be there are a few typing errors above as I haven't verified it, but I'm sure you get the idea).


    Best regards,

    Henrik Dahl

  • Kanaan

    That's likely not the best way to get rid of all the rows, since it forces DLINQ to load all the rows first and then submit individual deletes for each one.

    We are still considering features for DLINQ, and set-based insert, update and delete commands are among them.  If you have any thoughts on how this should work or if they should exist at all, let us know.



  • DRK12345




    [
    Table]
    public class Source
    {
        [
    Column(DbType = "UniqueIdentifier NOT NULL", Id = true)]
       
    public Guid SourceID;

        [
    Column(DbType = "UniqueIdentifier")]
        public Guid ParentID;

        [Association(ThisKey = "ParentID")]
        public Source Parent;

        [Association(OtherKey = "ParentID")]
        public EntitySet<Source> Sources = new EntitySet<Source>();
    }


     


  • DevB

    Batched CRUD would work (I suspect this isn't what you meant by "set-based...").  I recall this being one of the roll-your-own hacks in the 1.x days, and I haven't checked it out in 2.0.

    Still haven't had the time to try it out, but if you know the server can execute IL (eg, by asking if it knows all the functions used)...

    I'd also be interested in seeing DDL support, with (potentially) schema versioning.  One of the nastiest problems I've had to deal with on-the-job was schema updates required for updates to live software.  Having a canonical pattern addressing how to specify deltas and how to achieve them (if manual transformation is required) would, I think, address a troublesome management issue.  Being able to pass a schema to a new-table api would be great.  Being able to pass a schema to a compare-table api would be really cool.  Being able to pass a schema (including transform method) to a modify-table api would be ...

    :)


  • support for hierarchical tables?