/** * Remove a dynamic type from the system. * * This implementation assumes that the dynamic type has no relationships to * it and that it is not involved in an inheritance relationship. If there * are concurrent processes using this type when it is removed some * exceptions may occur. * * @param session * @param typeName */ public void removeType(String typeName) { DynamicType type = getType(typeName); if (type != null) { getSession().getIdentityMapAccessor().initializeIdentityMap(type.getJavaClass()); ClassDescriptor descriptor = type.getDescriptor(); getSession().getProject().getOrderedDescriptors().remove(descriptor); getSession().getProject().getDescriptors().remove(type.getJavaClass()); } }
/** * Remove a dynamic type from the system. * * This implementation assumes that the dynamic type has no relationships to * it and that it is not involved in an inheritance relationship. If there * are concurrent processes using this type when it is removed some * exceptions may occur. * * @param typeName */ public void removeType(String typeName) { DynamicType type = getType(typeName); if (type != null) { getSession().getIdentityMapAccessor().initializeIdentityMap(type.getJavaClass()); ClassDescriptor descriptor = type.getDescriptor(); fqClassnameToDescriptor.remove(descriptor.getJavaClassName()); getSession().getProject().getOrderedDescriptors().remove(descriptor); getSession().getProject().getDescriptors().remove(type.getJavaClass()); //bug 430318 - clear the parsed cache as queries in that cache could be using this descriptor getSession().getProject().getJPQLParseCache().clear(); ((AbstractSession)getSession()).getCommitManager().getCommitOrder().remove(type.getJavaClass()); } }
/** * Remove a dynamic type from the system. * * This implementation assumes that the dynamic type has no relationships to * it and that it is not involved in an inheritance relationship. If there * are concurrent processes using this type when it is removed some * exceptions may occur. * * @param typeName */ public void removeType(String typeName) { DynamicType type = getType(typeName); if (type != null) { getSession().getIdentityMapAccessor().initializeIdentityMap(type.getJavaClass()); ClassDescriptor descriptor = type.getDescriptor(); fqClassnameToDescriptor.remove(descriptor.getJavaClassName()); getSession().getProject().getOrderedDescriptors().remove(descriptor); getSession().getProject().getDescriptors().remove(type.getJavaClass()); //bug 430318 - clear the parsed cache as queries in that cache could be using this descriptor getSession().getProject().getJPQLParseCache().clear(); ((AbstractSession)getSession()).getCommitManager().getCommitOrder().remove(type.getJavaClass()); } }