← Back to team overview

dhis2-devs team mailing list archive

Re: DHIS 2

 

Omer,

Jason explains about UIDs, but you are actually asking about internal
dataelementid numbers?

Then note that all internal id numbers (e.g. dataelementid,
organisationunitid, periodid, etc) are generated sequentially from a
hibernate sequence. if you look at any of your postgresql databases in e.g.
pgAdmin, then expand "schemas", you will see there is one Sequence defined
called hibernate_sequence - that's the one being used to generate all kinds
of internal ids

You CAN generate such internal ids yourself, but you must be very careful:
- make sure the instance if offline
- make absolutely sure that you generate numbers higher than the current
hibernate_sequence
- make absolutely sure that you update the hibernate_sequence current/next
numbers to something larger than the highest number you have generated
yourself.

In general I've only used the above method when absolutely necessary - much
better to use the API and let it handle the inserts.

Regards
Calle

On 3 August 2017 at 10:42, Jason Pickering <jason.p.pickering@xxxxxxxxx>
wrote:

> Hi Omer,
> Have you had a look at our user manual?
>
> https://docs.dhis2.org/master/en/developer/html/webapi_
> system_resource.html#d0e11013
>
>
> You can also generate these your self. They are just 11 character codes,
> which start with a letter, followed by a combination of letters and
> numbers.
>
> Regards,
> Jason
>
>
> On Thu, Aug 3, 2017 at 10:33 AM, Omer Butt <omerbutt2521@xxxxxxxxx> wrote:
>
>> Aoa SIir,
>> Kindly tell me the procedure how data elements id is Created ?
>> Will i generate it dynamically ?
>>
>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~dhis2-devs
>> Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~dhis2-devs
>> More help   : https://help.launchpad.net/ListHelp
>>
>>
>
>
> --
> Jason P. Pickering
> email: jason.p.pickering@xxxxxxxxx
> tel:+46764147049 <+46%2076%20414%2070%2049>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~dhis2-devs
> Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dhis2-devs
> More help   : https://help.launchpad.net/ListHelp
>
>


-- 

*******************************************

Calle Hedberg

46D Alma Road, 7700 Rosebank, SOUTH AFRICA

Tel/fax (home): +27-21-685-6472

Cell: +27-82-853-5352

Iridium SatPhone: +8816-315-19119

Email: calle.hedberg@xxxxxxxxx

Skype: calle_hedberg

*******************************************

References