Re: Problems with views in cayenne

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Fri Sep 16 2005 - 10:02:35 EDT

  • Next message: Lothar Krenzien: "Re: Problems with views in cayenne"

    On Sep 16, 2005, at 9:32 AM, Lothar Krenzien wrote:
    > Hi,
    >
    > thanks for your answer. Yes, I checked the code generated by
    > cayenne. That whas my first attemp. And it looks ok (I tried it on
    > the SQL console). For now I have that problem only with a single
    > query against the view. But than comprehensible ;(
    >
    >>
    >> The code looks reasonable. Have you checked the SQL generated by
    >> Cayenne,
    >> from the log?

    Looks like this is a problem with how a primary key is defined in the
    Modeler for this view. I understand that the view itself may not have
    PK notion in the DB, but you have to define it in Cayenne.

    To do that, open your project in the Modeler, navigate to DbEntity
    that describes the view, go to "Attributes" tab and then check "PK"
    on one or more columns, so that a combination of checked columns
    would give you a guaranteed *unique* identifier for a row. Otherwise
    you'd get the behavior you described.

    Andrus



    This archive was generated by hypermail 2.0.0 : Fri Sep 16 2005 - 10:02:45 EDT