Need help with read-only "one" entity in a one-to-many relationship being marked as MODIFIED

From: Mike Kienenberger (mkienen..laska.net)
Date: Mon Sep 22 2003 - 16:19:05 EDT

  • Next message: Andrus Adamchik: "Re: Implementing Entity "restricting qualifier" in application?"

    I have a read-only database entity Account with a corresponding object entity
    that has several to-many relationship lists defined.

    However, the persistenceState for Account is being changed from
    PersistenceState.COMMITTED to PersistenceState.MODIFIED whenever another
    entity (PaymentHistory for example) is created and added to a to-many
    relationship on the Account object (and I'm sure the same thing will happen
    on deletion and removal).

    The Object Entity Account can be arguably considered to have changed, but
    the Database Entity Account does not change.

    There's probably some pureist O/R theory at work here I don't understand [It
    probably has something to do with many-to-many and/or flattened
    relationships which I've never used.], but since I have many practical cases
    where I want a read-only object to have mutable lists of to-many
    non-read-only objects and can't think of any reasons not to allow it, I'd
    really like to have the option to have mutable to-many relationships defined
    from a read-only object.



    This archive was generated by hypermail 2.0.0 : Mon Sep 22 2003 - 16:13:02 EDT