Re: Select Query on Table with no Primary Key

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Fri Jun 08 2007 - 06:11:34 EDT

  • Next message: Tobias SCHOESSLER: "transaction for select queries"

    I am +0 on this feature. Maybe you are right and the users should
    have an opportunity to mess up the object graph in this case.... :-)

    Would you mind logging a Jira issue? And let's see what other Cayenne
    developers say on that.

    Thanks
    Andrus

    On Jun 8, 2007, at 10:25 AM, Dave Merrin wrote:

    > Hi Andrus,
    >
    > I had seen this as being a problem but not one that I really cared
    > about. The main functionality I was after was being able to
    > generate classes and have them mapped through to database tables.
    > I've got a fair bit of code using cayenne already which I wanted to
    > use again. It would be good if Cayenne had some options which
    > allowed for no primary keys but made you aware you would lose some
    > functionality.
    >
    > As mentioned before I've got round the problem for this project but
    > next time it might not be so easy.
    >
    > Cheers,
    >
    > Dave
    >
    > Andrus Adamchik wrote:
    >>
    >> Hi Craig,
    >>
    >> I can probably implement this in Cayenne in about 30 minutes, as
    >> Cayenne has a notion of "temporary id" (normally used for new
    >> uncommitted objects). The problem of course is uniquing. So say if
    >> a DB row is fetched from a table via a query, resulting in object
    >> A, and then later the same row is navigated to via a relationship
    >> from another object, resulting in a second object B, distinct from
    >> A. This breaks the fundamental assumption about object identity.
    >> So we chose not to go this way.
    >>
    >> Andrus
    >>
    >>
    >> On Jun 8, 2007, at 7:01 AM, Craig L Russell wrote:
    >>
    >>> Just FYI, when JDO reads data from tables without PK, it
    >>> internally creates a unique id, similar to a generated PK, for
    >>> the objects that it reads and these ids are discarded when no
    >>> longer needed. The fact that the mapping is for tables without PK
    >>> is known by the code that creates the temporary ids.
    >>>
    >>> Craig
    >>
    >
    >



    This archive was generated by hypermail 2.0.0 : Fri Jun 08 2007 - 06:12:02 EDT