* INTERNAL: (Public to allow testing to access)
* Return a new empty identity map to cache instances of the class.
*/
public IdentityMap buildNewIdentityMap(ClassDescriptor descriptor) {
if (this.session.isUnitOfWork()) {
ReferenceMode mode = ((UnitOfWorkImpl)this.session).getReferenceMode();
if (mode == ReferenceMode.FORCE_WEAK){
return new WeakUnitOfWorkIdentityMap(32, descriptor, this.session, true);
} else if (mode == ReferenceMode.WEAK && descriptor.getObjectChangePolicy().isAttributeChangeTrackingPolicy()) {
return new WeakUnitOfWorkIdentityMap(32, descriptor, this.session, true);
} else {