Proper way to insert a record and assign the id to the Entity object
I would use a slightly modified form of your option #2, which, instead of returning a modified version of the object, returns a new instance of that same entity.


There are two main reasons for this. The first is that you can't be entirely sure if the data stored in your DB is exactly that of your original item. The auto-incremented ID field is new, of course, but there could be triggers, constraints or login in stored procedures that might make the data subtly different. It's best to return the newly-stored entity from the DB call and have it fully synced with the DB.
The second reason is immutability. If your logic relies on updating a field in your entity after it's created, it means the ID field is mutable and can be changed elsewhere in your code. Having the class be immutable - unchangeable after instantiation - can make a lot of your logic simpler. You can have two threads operate on the same instance without worrying about race conditions between them, and other benefits beside.


Reason #2 is enough, in my opinion, to always clone your object, whether it's cloning-through-database-query or just cloning the instance before returning it.