回复: Re: Can we add auto-increment column in Ofbiz?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

回复: Re: Can we add auto-increment column in Ofbiz?

Lei Wu
Taher,

Thanks so much for your opinions! Could anyone help describe 'Sequences' more, on details of how to leverage this feature to make an column auto-incremented? Thanks in advance.
--
发自我的ONEPLUS智能手机

Taher Alkhateeb <[hidden email]>编写:

>Hi
>
>Two answers come to mind:
>
>1- you do not need this feature because it exists at the application level
>which you can also customize with services. Sequences are one such place.
>
>2- the whole purpose of the entity engine is to abstract the databases and
>provide independebce at the application level.
>
>So my opinion is not to focus on databases ever for any kind of logic. My 2
>cents.
>
>Taher Alkhateeb
>On Oct 26, 2014 6:22 AM, "[hidden email]" <[hidden email]>
>wrote:
>
>> Guys,
>>
>> We all know lots of databases support auto-increment columns, how can we
>> define such columns in ofbiz's entitymodel.xml file? Or other means to
>> implement this ?
>>
>> --
>> 发自我的ONEPLUS智能手机
Reply | Threaded
Open this post in threaded view
|

Re: Re: Can we add auto-increment column in Ofbiz?

ThiepLV
Hi wulei

You can use either <sequence-id-to-env ...> in minilang or
delegator.getNextSeqId(...) in Java.  The id sequence numbers are
stored in an entity SequenceValueItem.


2014-10-26 15:30 GMT+07:00 [hidden email] <[hidden email]>:

> Taher,
>
> Thanks so much for your opinions! Could anyone help describe 'Sequences'
> more, on details of how to leverage this feature to make an column
> auto-incremented? Thanks in advance.
> --
> 发自我的ONEPLUS智能手机
>
> Taher Alkhateeb <[hidden email]>编写:
>
> >Hi
> >
> >Two answers come to mind:
> >
> >1- you do not need this feature because it exists at the application level
> >which you can also customize with services. Sequences are one such place.
> >
> >2- the whole purpose of the entity engine is to abstract the databases and
> >provide independebce at the application level.
> >
> >So my opinion is not to focus on databases ever for any kind of logic. My
> 2
> >cents.
> >
> >Taher Alkhateeb
> >On Oct 26, 2014 6:22 AM, "[hidden email]" <[hidden email]>
> >wrote:
> >
> >> Guys,
> >>
> >> We all know lots of databases support auto-increment columns, how can we
> >> define such columns in ofbiz's entitymodel.xml file? Or other means to
> >> implement this ?
> >>
> >> --
> >> 发自我的ONEPLUS智能手机
>



--




*Best Regards--------------Lê Văn Thiệp *
*Student*Address: IT4 class, Hanoi University of Science and Technology
Mobile: 01656241339
Email: [hidden email] || [hidden email]
Y! Messenger: mucdong_demdaysao_lvt
My profile:  <https://www.facebook.com/thieplv> Facebook
<https://www.facebook.com/thieplv>
Reply | Threaded
Open this post in threaded view
|

Re: Can we add auto-increment column in Ofbiz?

Jacques Le Roux
Administrator
There is one exception though, when you want to have a special indexing like for invoice or orders, look at it from the getNextInvoiceId and
getNextOrderId services definitions
Beware of https://issues.apache.org/jira/browse/OFBIZ-3557

Jacques

Le 26/10/2014 09:59, Lê Văn Thiệp a écrit :

> Hi wulei
>
> You can use either <sequence-id-to-env ...> in minilang or
> delegator.getNextSeqId(...) in Java.  The id sequence numbers are
> stored in an entity SequenceValueItem.
>
>
> 2014-10-26 15:30 GMT+07:00 [hidden email] <[hidden email]>:
>
>> Taher,
>>
>> Thanks so much for your opinions! Could anyone help describe 'Sequences'
>> more, on details of how to leverage this feature to make an column
>> auto-incremented? Thanks in advance.
>> --
>> 发自我的ONEPLUS智能手机
>>
>> Taher Alkhateeb <[hidden email]>编写:
>>
>>> Hi
>>>
>>> Two answers come to mind:
>>>
>>> 1- you do not need this feature because it exists at the application level
>>> which you can also customize with services. Sequences are one such place.
>>>
>>> 2- the whole purpose of the entity engine is to abstract the databases and
>>> provide independebce at the application level.
>>>
>>> So my opinion is not to focus on databases ever for any kind of logic. My
>> 2
>>> cents.
>>>
>>> Taher Alkhateeb
>>> On Oct 26, 2014 6:22 AM, "[hidden email]" <[hidden email]>
>>> wrote:
>>>
>>>> Guys,
>>>>
>>>> We all know lots of databases support auto-increment columns, how can we
>>>> define such columns in ofbiz's entitymodel.xml file? Or other means to
>>>> implement this ?
>>>>
>>>> --
>>>> 发自我的ONEPLUS智能手机
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Can we add auto-increment column in Ofbiz?

ThiepLV
Thank Jacques for écrit

2014-10-27 12:31 GMT+07:00 Jacques Le Roux <[hidden email]>:

> There is one exception though, when you want to have a special indexing
> like for invoice or orders, look at it from the getNextInvoiceId and
> getNextOrderId services definitions
> Beware of https://issues.apache.org/jira/browse/OFBIZ-3557
>
> Jacques
>
> Le 26/10/2014 09:59, Lê Văn Thiệp a écrit :
>
>  Hi wulei
>>
>> You can use either <sequence-id-to-env ...> in minilang or
>> delegator.getNextSeqId(...) in Java.  The id sequence numbers are
>> stored in an entity SequenceValueItem.
>>
>>
>> 2014-10-26 15:30 GMT+07:00 [hidden email] <[hidden email]>:
>>
>>  Taher,
>>>
>>> Thanks so much for your opinions! Could anyone help describe 'Sequences'
>>> more, on details of how to leverage this feature to make an column
>>> auto-incremented? Thanks in advance.
>>> --
>>> 发自我的ONEPLUS智能手机
>>>
>>> Taher Alkhateeb <[hidden email]>编写:
>>>
>>>  Hi
>>>>
>>>> Two answers come to mind:
>>>>
>>>> 1- you do not need this feature because it exists at the application
>>>> level
>>>> which you can also customize with services. Sequences are one such
>>>> place.
>>>>
>>>> 2- the whole purpose of the entity engine is to abstract the databases
>>>> and
>>>> provide independebce at the application level.
>>>>
>>>> So my opinion is not to focus on databases ever for any kind of logic.
>>>> My
>>>>
>>> 2
>>>
>>>> cents.
>>>>
>>>> Taher Alkhateeb
>>>> On Oct 26, 2014 6:22 AM, "[hidden email]" <[hidden email]
>>>> >
>>>> wrote:
>>>>
>>>>  Guys,
>>>>>
>>>>> We all know lots of databases support auto-increment columns, how can
>>>>> we
>>>>> define such columns in ofbiz's entitymodel.xml file? Or other means to
>>>>> implement this ?
>>>>>
>>>>> --
>>>>> 发自我的ONEPLUS智能手机
>>>>>
>>>>
>>
>>


--




*Best Regards--------------Lê Văn Thiệp *
*Student*Address: IT4 class, Hanoi University of Science and Technology
Mobile: 01656241339
Email: [hidden email] || [hidden email]
Y! Messenger: mucdong_demdaysao_lvt
My profile:  <https://www.facebook.com/thieplv> Facebook
<https://www.facebook.com/thieplv>