Jpa entity generator assigns Integer type to the id fields of my entities. The corresponding attribute/column in my DB is of type serial ( yep
Long has a much bigger capacity than
Integer data type, so if you are not sure what length your data is going to be, its better to be using
Long type data...
On the other hand, since
Long has a bigger capacity it uses extra space and if you are sure that your data will not be bigger than the
Integer data type then using
Long just makes your code inefficient