You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by Jin Xu <xu...@gmail.com> on 2010/05/10 04:12:31 UTC

How to generate the "PK Property" for data object ?

Hello, friend:
    I`m a newer of Cayenne, i have a question:
        How to generate the "PK Property" for the data object when use
CayenneModeler to generate code (e.g. a property for the "id" column of a
table) , please ?

-- 
We are the best ! ! ! !

Re: How to generate the "PK Property" for data object ?

Posted by Andrus Adamchik <an...@objectstyle.org>.
This is about changing a PK value of a previously committed object.  
You shouldn't be doing that anyways, so generally this should not be  
an issue.

Andrus

On May 10, 2010, at 9:55 AM, Jin Xu wrote:

> Thank you very much ! ! ! !
>
> But i have an other question:
>
> *Be Careful*
> If you alter a record's primary key value and other records  
> reference that
> value, you need to ensure those other records pick up the change to  
> the key,
> too.
> Please give me a example of how to implement it ?


Re: How to generate the "PK Property" for data object ?

Posted by Jin Xu <xu...@gmail.com>.
Thank you very much ! ! ! !

But i have an other question:

*Be Careful*
If you alter a record's primary key value and other records reference that
value, you need to ensure those other records pick up the change to the key,
too.
Please give me a example of how to implement it ?

Re: How to generate the "PK Property" for data object ?

Posted by Andrus Adamchik <an...@objectstyle.org>.
(A note to self - need to move this page in the Modeler Guide)

On May 10, 2010, at 9:33 AM, Andrey Razumovsky wrote:

> Hi,
>
> See https://cwiki.apache.org/CAY/mapping-primary-keys.html
>
> 2010/5/10 Jin Xu <xu...@gmail.com>
>
>> Hello, friend:
>>   I`m a newer of Cayenne, i have a question:
>>       How to generate the "PK Property" for the data object when use
>> CayenneModeler to generate code (e.g. a property for the "id"  
>> column of a
>> table) , please ?
>>
>> --
>> We are the best ! ! ! !
>>
>
>
>
> -- 
> Andrey


Re: How to generate the "PK Property" for data object ?

Posted by Andrey Razumovsky <ra...@gmail.com>.
Hi,

See https://cwiki.apache.org/CAY/mapping-primary-keys.html

2010/5/10 Jin Xu <xu...@gmail.com>

> Hello, friend:
>    I`m a newer of Cayenne, i have a question:
>        How to generate the "PK Property" for the data object when use
> CayenneModeler to generate code (e.g. a property for the "id" column of a
> table) , please ?
>
> --
> We are the best ! ! ! !
>



-- 
Andrey