Re: Problems with views in cayenne

From: Lothar Krenzien (lkrenzie..eb.de)
Date: Fri Sep 16 2005 - 11:14:47 EDT

  • Next message: Cris Daniluk: "Re: Delete cascade problem"

    Hi Andrus ,

    thanks for your suggestion. I checked the properties in the modeler and found that the View had a primary key but on the wrong column. Now I have a PK on a ID and a date column. So the values are guaranteed *unique*. I also compared it with a view which seems to work.

    So I corrected it, generated and redeployed all the classes and also cleared the tomcat working dir. But unfortunately it didn't helped. The view returns data from january to may but Cayenne gets only the data from march to may. Strangely all the values exists twice in the result list !?

    Lothar

    > 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

    ______________________________________________________________
    Verschicken Sie romantische, coole und witzige Bilder per SMS!
    Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193



    This archive was generated by hypermail 2.0.0 : Fri Sep 16 2005 - 11:14:52 EDT