JPAContainer: get created id (object)

How can I retreive the object which I just have created over JPAContainer?

For example:
JPAContainer newContainer = JPAContainerFactory.makeBatchable(Address.class, “mydb”);
// I have to remove autocommit
newContainer.addEntity(new Address());

I need the id of new address.

newContainer.addEntity() return UUID, I have no idea where I can use it.
newContainer.lastItemId() is not good idea to use it (when the table is empty this can throw ArrayOfBoundException).

Hey freekode,

19.4.2. Creating and Accessing Entities
might help?

No. Ok, I try to describe:

Address newAddress = new Address();

and I neeed the id of newAddress, how can I get it?

well, in the first message, I wrote two additional lines:
it means, that after calling addEntity method, the entity will not be in database, it just saved in memory, and in this situation (as I wrote before), addEntity method return UUID, this not id from database, this is id of the entity in memory (I dont need it).
And for my situation this example is not valid.

Perhaps this will help?!/thread/1170858/7589964