Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] PersistenceUnitUtil#getIdentifier(Object): should return generated ID after flush(), right?

I am surprised you are getting null.

How is the entity mapped?  Is it a simple direct mapping, or is the id somehow derived from a relatinship?

-Tom

On 19/08/2013 6:37 PM, Laird Nelson wrote:
I'm in the middle of a transaction.

I persist an entity whose ID is generated.

I call flush().

I verify that em.contains(entity).

I verify that entity.getMyIdentifier() is non-null and numeric (i.e. the ID generation worked).

I then say: em.getEntityManagerFactory().getPersistenceUnitUtil().getIdentifier(entity).

The result is null.

Is that by design?  Or should I file a bug?

Best,


_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users


Back to the top