@DeadlockAutoRestart public void execute() { _execute(); } }
@Transactional private void _execute() { scripts(); }
protected void remove(Object k) { Field f = EntityMetadata.getPrimaryKeyField(k.getClass()); try { f.setAccessible(true); sql(String.format("DELETE FROM %s vo WHERE vo.%s = :value", k.getClass().getSimpleName(), f.getName())) .param("value", f.get(k)).execute(); } catch (IllegalAccessException e) { throw new CloudRuntimeException(e); } }
protected <K> K reload(K k) { flush(); databaseFacade.getEntityManager().refresh(k); return k; }