Confused by inconsistent behaviour with AutoIncrementing Primary Key #27
-
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
I realise the reason why it had been possible was because I had set Id as a long rather than an int as it is in the table, which would allow me to put in 0. Is it intentional that 0 triggers the AutoIncrement while any other number positive or negative will override it? Any explanation on what is happening at any stage here would be welcome given I am quite lost about what could be happening behind the scenes here and if I feel like what I am doing is a workaround then maybe AutoQuery might not be the way to go? I am not overly familiar with MySQL either. |
Beta Was this translation helpful? Give feedback.
-
|
The OrmLite attributes, e.g. and if you have an |
Beta Was this translation helpful? Give feedback.





The OrmLite attributes, e.g.
[AutoIncrement]needs to be on the Data Model (e.g.Address) not on the Request DTO.and if you have an
[AutoIncrement]PK likeIdit shouldn't be on theICreateDb<T>Request DTO as the RDBMS should be generating it.