Hi Prashant,

We have an attribute named *"sequence-bank-size" *in entity tag of entitymodel.xml file. Set its value to 1 so that it will increment the sequence by 1.

Refer SequenceUtil.java file, here you have *startSeqId *variable in SequenceBank class. As you have customize need to start sequence with 30000000 so just patch this value for *startSeqId*.

This may be the solution of your problem but I wonder don't we have any configuration available in OFBiz for doing this or it needs implementation?

Thoughts are most welcome.

Thanks and Regards,
-- Vivek Mishra
*
*Prashant Punekar wrote:
Hi,

I am using mysql version 5.1.23 database.

The requirement is:

I have an entity defined in entity model -
<entity entity-name="nsInventoryAutoIncrement">
      <description>This entity stores the unique auto increment value starting from 3 
trillion</description>
      <field name="inventorySeqId" type="numeric">
          <description>Inventory Sequence Id</description>
      </field>
      <field name="orderItemSeq" type="short-varchar">
          <description>This store orderId_OrderItemSeqId</description>
      </field>
       <prim-key field="inventorySeqId"/>
     </entity>


I would like to initialize the value of id column - inventorySeqId to say 
"30000000".
So when I do delegator.getNextSeqIdLong("nsInventoryAutoIncrement"), I should 
get 30000001.

First all I couldn't set the default value to 3000000.
So I added a dummy record with id as 3000000 expecting that the next seq method 
should return me 3000001 but its still returning me 10001 onwards. It seems 
that the auto increment default value for all entities is set to 10000.
How do I change it for one entity?

Regards,
Prashant

________________________________
http://www.mindtree.com/email/disclaimer.html

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to