/** * Saves a Drawing Image Record */ public ims.core.vo.DrawingImageVo saveDrawingImage(ims.core.vo.DrawingImageVo drawingImage) throws StaleObjectException { if(!drawingImage.isValidated()) throw new DomainRuntimeException("Drawing Image Value Object not validated"); DomainFactory factory = getDomainFactory(); DrawingImage doDrawingImage = DrawingImageVoAssembler.extractDrawingImage(factory, drawingImage); if(doDrawingImage.getVersionNumber() == null) doDrawingImage.setVersionNumber(new Integer(1)); else doDrawingImage.setVersionNumber(new Integer(drawingImage.getVersionNumber().intValue() + 1)); try { factory.save(doDrawingImage); } catch (DomainException e) { throw new DomainRuntimeException("DomainException occurred " + e.getMessage()); } drawingImage.setID_DrawingImage(doDrawingImage.getId()); drawingImage.setVersionNumber(doDrawingImage.getVersionNumber()); return drawingImage; }