/** * Execute <tt>INSERT</tt> operation on the database * @param xrService parent <code>XRService</code> that owns this <code>Operation</code> * @param invocation contains runtime argument values to be bound to the list of * {@link Parameter}'s. * @return result - <code>null</code> as the underlying <tt>INSERT</tt> operation on * the database does not return a value. * * @see {@link Operation} */ @Override public Object invoke(XRServiceAdapter xrService, Invocation invocation) { Object instance = invocation.getParameters().toArray()[0]; UnitOfWork uow = xrService.getORSession().acquireUnitOfWork(); uow.registerNewObject(instance); uow.commit(); return null; } }
/** * Execute <tt>INSERT</tt> operation on the database * @param xrService parent <code>XRService</code> that owns this <code>Operation</code> * @param invocation contains runtime argument values to be bound to the list of * {@link Parameter}'s. * @return result - <code>null</code> as the underlying <tt>INSERT</tt> operation on * the database does not return a value. * * @see Operation */ @Override public Object invoke(XRServiceAdapter xrService, Invocation invocation) { Object instance = invocation.getParameters().toArray()[0]; UnitOfWork uow = xrService.getORSession().acquireUnitOfWork(); uow.registerNewObject(instance); uow.commit(); return null; } }