You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by Ashish Vijaywargiya <vi...@gmail.com> on 2009/07/08 15:38:38 UTC

Move startSeqId from SequenceUtil.java file to some property file?

In SequenceUtil.java file line #112 is responsible to generate the first
sequence id for all the tables where primary key is auto generated.
By changing this value I can change the start sequence Id for the tables.
Here is the line from that file:

public static final long startSeqId = 10000;

Isn't it good to move this value in some property file?

The reason for this change is as follows:
Suppose a I am using OFBiz 4.0.
Now I am migrating data which has Party Records in the range of 50,000 or
more.
The sequence ids for party is having sequence id started from 10000, 10001
... and so on.
And the client is having similar range of data for Order and other
associated entities.

This move will help us to do changes in property file instead of changing
java code snippet.

Thoughts?
--
Ashish

Re: Move startSeqId from SequenceUtil.java file to some property file?

Posted by Ashish Vijaywargiya <vi...@gmail.com>.
Thanks David for the pointer.
Somehow I forgot this feature.

--
Ashish

On Wed, Jul 8, 2009 at 8:12 PM, David E. Jones <de...@me.com> wrote:

>
> The approach I've always used was to put the data in the sequence value
> entity itself, and then you have granular control over each
> entity/sequence too. When migrating from an older version of OFBiz
> usually you'll migrate the sequence values as well too.
>
> On the other hand there may be reasons why that won't work, though I
> can't think of any off the top of my head (and I haven't run into any).
> Is there something you've run into that would prevent you from taking
> this approach?
>
> -David
>

Re: Move startSeqId from SequenceUtil.java file to some property file?

Posted by "David E. Jones" <de...@me.com>.
The approach I've always used was to put the data in the sequence value
entity itself, and then you have granular control over each
entity/sequence too. When migrating from an older version of OFBiz
usually you'll migrate the sequence values as well too.

On the other hand there may be reasons why that won't work, though I
can't think of any off the top of my head (and I haven't run into any).
Is there something you've run into that would prevent you from taking
this approach?

-David


On Wed, 2009-07-08 at 19:08 +0530, Ashish Vijaywargiya wrote:
> In SequenceUtil.java file line #112 is responsible to generate the first
> sequence id for all the tables where primary key is auto generated.
> By changing this value I can change the start sequence Id for the tables.
> Here is the line from that file:
> 
> public static final long startSeqId = 10000;
> 
> Isn't it good to move this value in some property file?
> 
> The reason for this change is as follows:
> Suppose a I am using OFBiz 4.0.
> Now I am migrating data which has Party Records in the range of 50,000 or
> more.
> The sequence ids for party is having sequence id started from 10000, 10001
> ... and so on.
> And the client is having similar range of data for Order and other
> associated entities.
> 
> This move will help us to do changes in property file instead of changing
> java code snippet.
> 
> Thoughts?
> --
> Ashish