Add serial column in entity

I have a column integer and after that I changed to serial in postgresql database.
After that I removed the field from edit UI.
Now I can’t use editor screen, because insert a null value.
How I can change data type from integer to serial in entity?
Also for ID column where is located in cuba (start value, increment, etc) because I changed the sequence function (the name, start value, increment) in database but cuba continue to insert using/from old value.
Thanks in advance.

Now I resolved to use serial using listener

    private UniqueNumbersService unService;
    public void onBeforeInsert(CereriRacordare entity, EntityManager entityManager) {


This give me unique numbers from 1 to n, incremented by 1.
How I can reset the numbers and how I start from define number for this nrinreg column? Because I having records with numbers 1,2 and 3 for nrinreg column but now start with number 1.

Remain the question with where is located the start number and increment for ID column from an entity, because I wish also to renumber/reset the ID column.

I found how to reset the numbers for unService. After I added function onBeforeInsert, cuba build a sequence, in postgresql database, named seq_un_cereriracordare_numbers.

Remain the question where is located the start number and increment for ID column from an entity, because I build a new sequence and alter to this new sequence the ID column but cuba using old sequence.

I am back with last question from last post.
I try to put the question with another words.
I created a new entity and this created for me a table in database.
I not like the sequence name and the increment numbers (was hundred numbers)
After that I change the name for sequence and increment value and also I alter the table to this new sequence, but my application continue to use the old sequence.
Where is in Cuba defined for a entity the name for sequence to be used for ID column.

Hi @florin.tanasa,

Thank you for your question! We will think about implementing it in the platform. Currently you can find the way to achieve such behavior in this project.


Thank you Aleksey,
but was more easy to use the old sequence.