750751752753754755756757758759760
throw new IllegalArgumentException("Invalid entity name: " + entityName); } Persistent object; try { object = (Persistent) descriptor.createObject(); } catch (Exception ex) { throw new CayenneRuntimeException("Error instantiating object.", ex); }
16511652165316541655165616571658165916601661
// create and merge into a new object else { Persistent localObject; localObject = (Persistent) descriptor.createObject(); localObject.setObjectContext(this); localObject.setObjectId(id); getGraphManager().registerNode(id, localObject);
723724725726727728729730731732733
15781579158015811582158315841585158615871588
754755756757758759760761762763764
16361637163816391640164116421643164416451646
313314315316317318319320321322323
+ persistentClass); } ClassDescriptor descriptor = getEntityResolver().getClassDescriptor( entity.getName()); Persistent object = (Persistent) descriptor.createObject(); registerNewObject(object, entity.getName(), descriptor); return object; } /**
413414415416417418419420421422423
// hierarchy // this context is. Persistent localObject; localObject = (Persistent) descriptor.createObject(); localObject.setObjectContext(this); localObject.setObjectId(id); getGraphManager().registerNode(id, localObject);
496497498499500501502503504505506
ClassDescriptor descriptor = getEntityResolver().getClassDescriptor( id.getEntityName()); Persistent object; synchronized (graphManager) { object = (Persistent) descriptor.createObject(); object.setPersistenceState(PersistenceState.HOLLOW); object.setObjectContext(this); object.setObjectId(id);
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() {