253254255256257258259260261262263
+ persistentClass); } ClassDescriptor descriptor = getEntityResolver().getClassDescriptor( entity.getName()); T object = (T) descriptor.createObject(); registerNewObject((Persistent) object, entity.getName(), descriptor); return object; } /**
360361362363364365366367368369370
// hierarchy // this context is. Persistent localObject; localObject = (Persistent) descriptor.createObject(); localObject.setObjectContext(this); localObject.setObjectId(id); getGraphManager().registerNode(id, localObject);
436437438439440441442443444445446
ClassDescriptor descriptor = getEntityResolver().getClassDescriptor( id.getEntityName()); Persistent object; synchronized (graphManager) { object = (Persistent) descriptor.createObject(); object.setPersistenceState(PersistenceState.HOLLOW); object.setObjectContext(this); object.setObjectId(id);
547548549550551552553554555556557
throw new IllegalArgumentException("Invalid entity name: " + entityName); } Persistent object; try { object = (Persistent) descriptor.createObject(); } catch (Exception ex) { throw new CayenneRuntimeException("Error instantiating object.", ex); }
12201221122212231224122512261227122812291230
// create and merge into a new object else { Persistent localObject; localObject = (Persistent) descriptor.createObject(); localObject.setObjectContext(this); localObject.setObjectId(id); getGraphManager().registerNode(id, localObject);
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() {
708709710711712713714715716717718
15631564156515661567156815691570157115721573
343344345346347348349350351352353
446447448449450451452453454455456