Constructs a new persistent factory for objects of the specified class with
the named unique identifier attributes.
@param cls the class of objects managed by this factory
@param keys a list of unique identifiers for instances of the specified class
194626
protected void init(Class<T> cls, Key ... keys) {
    	
		// get the columns 
        List<String> targetColumns = new ArrayList<String>();
        Class<?> clazz = cls;
        while( clazz != null && !clazz.equals(Object.class) ) {
            Field[] fields = clazz.getDeclaredFields();
            
            for( Field f : fields ) {
                int m = f.getModifiers();
            
                if( Modifier.isTransient(m) || Modifier.isStatic(m) ) {
                    continue;
                }
                if (f.getType().getName().equals(Collection.class.getName())) {
                	continue; // this is handled by dependency manager
                }
                if( !f.getType().getName().equals(Translator.class.getName()) ) {
                	targetColumns.add(f.getName());    
                	types.put(f.getName(), f.getType());
                }
            }
            clazz = clazz.getSuperclass();
        }
        
        columns = new String[targetColumns.size()];
        
        for (int i = 0; i < targetColumns.size(); i++) {
        	columns[i] = targetColumns.get(i);
        }        
    }
107416
public static Key createKey(Key parent, Class<?> clazz, String name) {
		return KeyFactory.createKey(parent, getKind(clazz), name);
	}
61925
public void setJarByClass(Class cls) {
    String jar = findContainingJar(cls);
    if (jar != null) {
      setJar(jar);
    }
  }
430323
public static <T> T newInstance(final Class<T> clas, final Object... params) {
		try {
			final Class<?>[] paramClasses = JKObjectUtil.toClassesFromObjects(params);
			if (paramClasses.length == 0) {
				return clas.newInstance();
			}
			return ConstructorUtils.invokeConstructor(clas, params);
		} catch (final Exception e) {
			throw new RuntimeException(e);
		}
	}
497566
public static Key createKey(Key parent, Class<?> clazz, long id) {
		return KeyFactory.createKey(parent, getKind(clazz), id);
	}
292152
static synchronized BeanFactoryId register(Class<?> clazz, Set<String> pathParams,
                                               List<RequestObjectResolver> objectResolvers) {
        final BeanFactoryId beanFactoryId = new BeanFactoryId(clazz, pathParams);
        if (!factories.containsKey(beanFactoryId)) {
            final AnnotatedBeanFactory<Object> factory = createFactory(beanFactoryId, objectResolvers);
            if (factory != null) {
                factories.put(beanFactoryId, factory);
                logger.debug("Registered a bean factory: {}", beanFactoryId);
            } else {
                factories.put(beanFactoryId, unsupportedBeanFactory);
            }
        }
        return beanFactoryId;
    }
359536
protected ClassDescriptor selectClassDescriptor(Map row) throws PersistenceBrokerException
    {
        ClassDescriptor result = m_cld;
        Class ojbConcreteClass = (Class) row.get(OJB_CONCRETE_CLASS_KEY);
        if(ojbConcreteClass != null)
        {
            result = m_cld.getRepository().getDescriptorFor(ojbConcreteClass);
            // if we can't find class-descriptor for concrete class, something wrong with mapping
            if (result == null)
            {
                throw new PersistenceBrokerException("Can't find class-descriptor for ojbConcreteClass '"
                        + ojbConcreteClass + "', the main class was " + m_cld.getClassNameOfObject());
            }
        }
        return result;
    }
1290309
@Override
	public void remove(final Object key, final Class<?> clas) {
		this.logger.debug("@remove :".concat(key.toString()).concat(" with class : ".concat(clas.getName())));
		getCachableMap(clas).remove(key);
	}
342242
def resolve(self, key: Any) -> Any:
        
        if key not in self._singletons:
            # if registered, determine if the result will be shared
            if key in self._factories:
                factory = self._factories[key]
                result = factory(self)
                if isinstance(factory, SingletonFactory):
                    self._singletons[key] = result
                return result
            # if not registered, try to automatically resolve it based on
            # its annotations. Automatically resolved keys are always shared
            elif isinstance(type(key), type):
                result = self._resolve_class(key)
                self._singletons[key] = result
                return result
            else:
                msg = 'Unable to resolve factory for key %s' % key
                raise ResolveException(msg)
        else:
            return self._singletons[key]
878009
private void storeCollections(Object obj, ClassDescriptor cld, boolean insert) throws PersistenceBrokerException
    {
        // get all members of obj that are collections and store all their elements
        Collection listCods = cld.getCollectionDescriptors();
        // return if nothing to do
        if (listCods.size() == 0)
        {
            return;
        }
        Iterator i = listCods.iterator();
        while (i.hasNext())
        {
            CollectionDescriptor cod = (CollectionDescriptor) i.next();

            // if CASCADE_NONE was set, do nothing with referenced objects
            if (cod.getCascadingStore() != ObjectReferenceDescriptor.CASCADE_NONE)
            {
                Object referencedObjects = cod.getPersistentField().get(obj);
                if (cod.isMtoNRelation())
                {
                    storeAndLinkMtoN(false, obj, cod, referencedObjects, insert);
                }
                else
                {
                    storeAndLinkOneToMany(false, obj, cod, referencedObjects, insert);
                }

                // BRJ: only when auto-update = object (CASCADE_OBJECT)
                //
                if ((cod.getCascadingStore() == ObjectReferenceDescriptor.CASCADE_OBJECT)
                        && (referencedObjects instanceof ManageableCollection))
                {
                    ((ManageableCollection) referencedObjects).afterStore(this);
                }
            }
        }
    }
629180
@Override
	public ZooClass addClass(Class<?> cls) {
		DBTracer.logCall(this, cls);
    	checkValidity(true);
		return sm.createSchema(null, cls);
	}
509906
public void setKeys(java.util.Collection<String> keys) {
        if (keys == null) {
            this.keys = null;
            return;
        }

        this.keys = new java.util.ArrayList<String>(keys);
    }
410948
function(attrs) {
    for (var key in attrs) {
      //convert cls to class
      var mappedKey = key == 'cls' ? 'class' : key;
      
      this.attributes[mappedKey] = attrs[key];
    }
    return this;
  }
1350476
private static LinkedHashMap<Class<?>, Integer> createRegisteredSubclassTags(LinkedHashSet<Class<?>> registeredSubclasses) {
		final LinkedHashMap<Class<?>, Integer> classToTag = new LinkedHashMap<>();

		int id = 0;
		for (Class<?> registeredClass : registeredSubclasses) {
			classToTag.put(registeredClass, id);
			id ++;
		}

		return classToTag;
	}
796008
@Override
	public Map<Object, Object> getCachableMap(final Class<?> clas) {
		this.logger.debug("@getCachableMap for class ", clas.getName());
		Map<Object, Object> map = this.cachablesMaps.get(clas);
		if (map == null) {
			this.logger.debug("Cachable map not found , create one");
			map = new HashMap<>();
			this.cachablesMaps.put(clas, map);
		} else {
			// logger.debug("map found : ".concat(map.keySet().toString()));
		}
		return map;
	}
1040961
public static final Builder publicKey(Class<?> cls, String resource) {
        return new Builder().publicKey(cls, resource);
    }
434813
public void setKeys(java.util.Collection<DimensionKeyDescription> keys) {
        if (keys == null) {
            this.keys = null;
            return;
        }

        this.keys = new java.util.ArrayList<DimensionKeyDescription>(keys);
    }