544545546547548549550551552553554
ClassDescriptor descriptor = getEntityResolver().getClassDescriptor( id.getEntityName()); Persistent object; synchronized (graphManager) { object = (Persistent) descriptor.createObject(); object.setPersistenceState(PersistenceState.HOLLOW); object.setObjectContext(this); object.setObjectId(id);
530531532533534535536537538539540
331332333334335336337338339340341
+ persistentClass); } ClassDescriptor descriptor = getEntityResolver().getClassDescriptor( entity.getName()); T object = (T) descriptor.createObject(); registerNewObject((Persistent) object, entity.getName(), descriptor); return object; } /**
434435436437438439440441442443444
// hierarchy // this context is. Persistent localObject; localObject = (Persistent) descriptor.createObject(); localObject.setObjectContext(this); localObject.setObjectId(id); getGraphManager().registerNode(id, localObject);
710711712713714715716717718719720
throw new IllegalArgumentException("Invalid entity name: " + entityName); } Persistent object; try { object = (Persistent) descriptor.createObject(); } catch (Exception ex) { throw new CayenneRuntimeException("Error instantiating object.", ex); }
15601561156215631564156515661567156815691570
// create and merge into a new object else { Persistent localObject; localObject = (Persistent) descriptor.createObject(); localObject.setObjectContext(this); localObject.setObjectId(id); getGraphManager().registerNode(id, localObject);
321322323324325326327328329330331
426427428429430431432433434435436
514515516517518519520521522523524
90919293949596979899100
// presumably id's entity name should be of the right subclass. final ClassDescriptor targetDescriptor = targetResolver.getClassDescriptor(id .getEntityName()); final Persistent target = (Persistent) targetDescriptor.createObject(); target.setObjectId(id); seen.put(id, target); descriptor.visitProperties(new PropertyVisitor() {