sven wrote:
database (persistent objects) and have a primary key. Objects can also be transient - when they are created (Object o = new Object()). In this
I dont think this is the main reason since long can just have unsaved as 0, so it works similarly, especially if you have a native key which starts above 0. If you are putting your ID as the key of a Map, or passing it to methods that take Object as an input, then the long type will need to be constantly wrapped and unwrapped, but the Long one is already there. Its not a ton of overhead, but for performance nuts, reducing the number of instances created matters.
Chris