/** * Accessor for the target class name for the specified single field identity. * @param id The identity * @return The target class name */ public String getTargetClassNameForSingleFieldIdentity(Object id) { // TODO Use JPOX-internal SingleFieldIdentity if (id instanceof SingleFieldIdentity) { return ((SingleFieldIdentity)id).getTargetClassName(); } return null; }
/** * Accessor for the target class name for the specified single field identity. * @param id The identity * @return The target class name */ public String getTargetClassNameForSingleFieldIdentity(Object id) { // TODO Use JPOX-internal SingleFieldIdentity if (id instanceof SingleFieldIdentity) { return ((SingleFieldIdentity)id).getTargetClassName(); } return null; }
private Cache getCacheForId(Object id) { if (id instanceof SingleFieldIdentity) { return getCacheForClass(((SingleFieldIdentity) id).getTargetClassName()); } if (id instanceof OID) { return getCacheForClass(((OID) id).getPcClass()); } return defaultCache; }
/** * Convenience method to ensure that the class defined by the passed SingleFieldIdentity * is managed by this store. * @param id Single Field Identity * @param clr ClassLoader resolver * @return The class name of the class associated to this identity */ public String manageClassForIdentity(SingleFieldIdentity id, ClassLoaderResolver clr) { String className = null; // Check that the implied class is managed className = id.getTargetClassName(); AbstractClassMetaData cmd = getMetaDataManager().getMetaDataForClass(className, clr); if (cmd.getIdentityType() != IdentityType.APPLICATION || !cmd.getObjectidClass().equals(id.getClass().getName())) { throw new JDOUserException(LOCALISER.msg("Identity.AssignedToIncorrectClass", id, cmd.getFullClassName())); } // If the class is not yet managed, manage it if (!managesClass(className)) { addClass(className, clr); } return className; }
targetClassName = ((SingleFieldIdentity)id).getTargetClassName();