if (nextDescriptor.getCMPPolicy().getMappedClass() != null) { mappedClassName = nextDescriptor.getCMPPolicy().getMappedClass().getName();
if (nextDescriptor.getCMPPolicy().getMappedClass() != null) { mappedClassName = nextDescriptor.getCMPPolicy().getMappedClass().getName();
if (nextDescriptor.getCMPPolicy().getMappedClass() != null) { mappedClassName = nextDescriptor.getCMPPolicy().getMappedClass().getName();
/** * This method is used to return the number of objects in a particular Identity Map * @param className the fully qualified name of the class to get number of instances of. * @exception thrown then the IdentityMap for that class name could not be found */ public Integer getNumberOfObjectsInIdentityMap(String className) throws ClassNotFoundException { //BUG 3982060: Always use the root class in combination with the identity map's getSize(class, true) to get an accurate count Class classWithIdentityMap = (Class)getSession().getDatasourcePlatform().getConversionManager().convertObject(className, ClassConstants.CLASS); Class rootClass = null; ClassDescriptor descriptor = getSession().getDescriptor(classWithIdentityMap); ClassDescriptor rootDescriptor; if (descriptor.hasInheritance()) { rootDescriptor = descriptor.getInheritancePolicy().getRootParentDescriptor(); } else { rootDescriptor = descriptor; } if (rootDescriptor.getCMPPolicy() != null) { if (rootDescriptor.getCMPPolicy().getMappedClass() != null) { rootClass = rootDescriptor.getCMPPolicy().getMappedClass(); } } if (rootClass == null) { rootClass = rootDescriptor.getJavaClass(); } return new Integer(getSession().getIdentityMapAccessorInstance().getIdentityMap(rootClass).getSize(rootClass, true)); }