Re: Table with no sequence

2009-03-20 Thread Michael Gentry
Well, almost all of us have had legacy schemas that did such things and we have to deal with them. Good luck! mrg On Fri, Mar 20, 2009 at 10:53 AM, wrote: > Hi, > > Thank you for all the feedback, i can see that there is plenty of solutions > that were not obvious at first. Yes I'm using 3.0

Re: Table with no sequence

2009-03-20 Thread hans
Hi, Thank you for all the feedback, i can see that there is plenty of solutions that were not obvious at first. Yes I'm using 3.0. At first i thought i was committing a sin making this question, i smelled something religious against meaningful primary keys in legacy systems. Regards Hans

Re: Table with no sequence

2009-03-20 Thread Michael Gentry
If you assign your primary key(s) manually, before telling Cayenne to commitChanges(), then you'll be fine. Cayenne will honor the PK value that you set without trying to replace it. You didn't mention which version of Cayenne, but for version 2.0 (and I suppose even in 3.0) you can override your

Re: Table with no sequence

2009-03-20 Thread Juergen Saar
I also have such a project ... I think it's pretty easy doing such work with cayenne. We use the validateForInsert method for generating the PrimaryKey. We started development with cayenne 1.x ... since Version 2 there are more ways to solve this isssue but you know "newer touch ..." 2009/3/20

Re: Table with no sequence

2009-03-19 Thread Aristedes Maniatis
On 20/03/2009, at 10:07 AM, h...@welinux.cl wrote: Hi, We have a legacy table that have a meaningful primary key, many code depends on it and it's not possible to alter it. We are building new java applications that need to insert in it. We would like to cayenne it and not use any sequence

Table with no sequence

2009-03-19 Thread hans
Hi, We have a legacy table that have a meaningful primary key, many code depends on it and it's not possible to alter it. We are building new java applications that need to insert in it. We would like to cayenne it and not use any sequence at all for making inserts... ¿ it's possible to do it