How to use AutoNumber properly?

-1
Created a new entity with the Id field as AutoNumber. Then found out it didn’t work well with the Post REST action. Had to change it back to Integer to get the correct Message mapping. In HSQL, there was always an addtional ID field as the internal ID column. So I suspect this AutoNumber doesn’t make much sense. I am using the latest Mendix Studio Pro 8.6.0. Maybe the new version caused this new issue.
asked
1 answers
2

Autonumbers do make sence to uniquely identify objects. But as you already found out using it directly in REST services can give you some problems. But with webservices it is always a good practice to work with in between (non) persistent objects whch you later process to the actual objects. The in between object would have an integer that you can then use to find the main object in the process step. Do note that if you want autonumbers without gaps you also need to create your own system because creating an object and not commit it does not reset the number counter.

Hope this clarifies autonumber a bit.

Regards,

Ronald

 

answered