private <T> List<T> getFromCache(Class<T> clazz, List<T> instances, ID... subjects) { for (ID id : subjects) { instances.add(id != null ? getCached(id, clazz) : null); } return instances; }
private <T> Map<ID, T> createInstances(MappedClass mappedClass, Class<T> clazz, boolean polymorphic, UID context, Map<ID, Multimap<UID, STMT>> directProps, Map<ID, Multimap<UID, STMT>> inverseProps) { Map<ID, T> idToInstance = new HashMap<ID, T>(directProps.size()); for (Map.Entry<ID, Multimap<UID, STMT>> entry : directProps.entrySet()) { T instance = getCached(entry.getKey(), clazz); if (instance == null) { PropertiesMap properties = new PropertiesMap(entry.getValue(), inverseProps.get(entry.getKey())); instance = getMappedObject(mappedClass, entry.getKey(), clazz, properties, polymorphic, context, false); if (instance != null) { idToInstance.put(entry.getKey(), instance); } } } return idToInstance; }
T instance = getCached(entry.getKey(), clazz); if (idToInstance.containsKey(entry.getKey())) { PropertiesMap properties = new PropertiesMap(entry.getValue(), inverseProps.get(entry.getKey()));
T instance = getCached(entry.getKey(), clazz); if (idToInstance.containsKey(entry.getKey())) { PropertiesMap properties = new PropertiesMap(entry.getValue(), inverseProps.get(entry.getKey()));
Set<ID> ids = new HashSet<ID>(subjects.length); for (ID id : subjects) { if (id != null && getCached(id, clazz) == null) { ids.add(id); T instance = null; if (subject != null && directProps.containsKey(subject)) { instance = getCached(subject, clazz); if (idToInstance.containsKey(subject)) { PropertiesMap properties = new PropertiesMap(directProps.get(subject), inverseProps.get(subject));
private <T> T convertMappedObject(ID subject, Class<T> requiredClass, boolean polymorphic, boolean injection) { UID context = getContext(requiredClass, subject, null); Object instance = getCached(subject, requiredClass); if (instance == null) { if (injection) {