/** * <p>Process entity request.</p> * @param pAddParam additional param * @param pRequestData Request Data * @throws Exception - an exception **/ @Override public final void process(final Map<String, Object> pAddParam, final IRequestData pRequestData) throws Exception { this.srvEntitiesPage.retrievePage(pAddParam, pRequestData); }
/** * <p>Geter for database ID.</p> * @return ID database **/ @Override public final int getIdDatabase() { return this.srvDatabase.getIdDatabase(); }
@Override public void persist(PRI persistInstrument) throws Exception { persistSrv.persist(elementUml, persistInstrument); }
/** * <p> * Read entities from stream (by given reader) and insert them * into DB with no changes. DB must be emptied before coping. * </p> * @param pAddParam additional params * @param pReader Reader * @throws Exception - an exception **/ @Override public final void readAndStoreEntities(final Map<String, Object> pAddParam, final Reader pReader) throws Exception { try { this.srvDatabase.setIsAutocommit(false); this.srvDatabase. setTransactionIsolation(ISrvDatabase.TRANSACTION_READ_UNCOMMITTED); this.srvDatabase.beginTransaction(); while (this.utilXml.readUntilStart(pReader, "entity")) { Object entity = this.srvEntityReader.read(pAddParam, pReader); this.srvOrm.insertEntity(pAddParam, entity); } this.srvDatabase.commitTransaction(); } catch (Exception ex) { this.srvDatabase.rollBackTransaction(); throw ex; } finally { this.srvDatabase.releaseResources(); } }
public EditorUseCaseFull(DLI dli, SrvEditUseCaseFull<UC, DLI> srvEdit) { super(dli, srvEdit, srvEdit.getSrvI18n().getMsg("use_case")); }
/** * <p>Initialize filler for given object class.</p> * @param pClass object class * @throws Exception - an exception **/ public final synchronized void init(final Class<T> pClass) throws Exception { this.objectClass = pClass; this.fieldsNames = new HashSet<String>(); Field[] fields = getUtlReflection().retrieveFields(this.objectClass); for (Field field : fields) { this.fieldsNames.add(field.getName()); } }
/** * <p> * Synchronize entity (that just read) with entity in database. * It just check if it's new. * </p> * @param pAddParam additional params * @param pEntity object * @return isNew if entity exist in database (need update) * @throws Exception - an exception **/ @Override public final boolean sync(final Map<String, Object> pAddParam, final Object pEntity) throws Exception { Object entityPbDb = getSrvOrm().retrieveEntity(pAddParam, pEntity); return entityPbDb == null; }
/** * <p>Prints number formatted by given decimal separator, decimal group * separator, decimal places after dot and digits in group.</p> * @param pNumber e.g. "12146678.12" * @param pDigSep decimal separator, e.g. "," * @param pDigGrSep decimal group separator, e.g. " " * @param pDecPlAfDot decimal places after dot, e.g. 2 * @param pDigitsInGroup Digits in group, e.g. 3 * @return String internationalized number, e.g. "12 146 678,12" **/ public final String printNumber(final String pNumber, final String pDigSep, final String pDigGrSep, final Integer pDecPlAfDot, final Integer pDigitsInGroup) { return this.srvNumberToString.print(pNumber, pDigSep, pDigGrSep, pDecPlAfDot, pDigitsInGroup); }
/** * <p> * Read entity attributes from stream. * </p> * @param pReader reader. * @param pAddParam additional params * @return attributes map * @throws Exception - an exception **/ @Override public final Map<String, String> readAttributes(final Reader pReader, final Map<String, Object> pAddParam) throws Exception { return this.utilXml.readAttributes(pReader, pAddParam); }
/** * <p>Process entity request.</p> * @param pAddParam additional param, e.g. return this line's * document in "nextEntity" for farther process * @param pRequestData Request Data * @param pEntity Entity to process * @return Entity processed for farther process or null * @throws Exception - an exception **/ @Override public final T process( final Map<String, Object> pAddParam, final T pEntity, final IRequestData pRequestData) throws Exception { this.srvOrm.deleteEntity(pAddParam, pEntity); return null; }
/** * <p>It must be invoked at once by Factory to improve performance * by not using locking during usage this converter.</p> * @param pClass entity class * @param pIdName entity ID name * @throws Exception - an exception **/ public final void init(final Class<T> pClass, final String pIdName) throws Exception { this.entityClass = pClass; this.getterId = getUtlReflection() .retrieveGetterForField(this.entityClass, pIdName); this.setterId = getUtlReflection() .retrieveSetterForField(this.entityClass, pIdName); }
/** * <p>Retrieve getter from given class by field name.</p> * @param pClazz - class * @param pFieldName - field name * @return Method getter. * @throws Exception if method not exist **/ @Override public final Method retrieveGetterForField(final Class<?> pClazz, final String pFieldName) throws Exception { String getterName = "get" + pFieldName.substring(0, 1).toUpperCase() + pFieldName.substring(1); return retrieveMethod(pClazz, getterName); }
@Override public void restore(PRI persistInstrument) throws Exception { persistSrv.restore(elementUml, persistInstrument); }
/** * <p>Prints number formatted by given decimal separator, decimal group * separator and decimal places after dot. Digits in group is 3.</p> * @param pNumber e.g. "12146678.12" * @param pDigSep decimal separator, e.g. "," * @param pDigGrSep decimal group separator, e.g. " " * @param pDecPlAfDot decimal places after dot, e.g. 2 * @return String internationalized number, e.g. "12 146 678,12" **/ @Override public final String print(final String pNumber, final String pDigSep, final String pDigGrSep, final Integer pDecPlAfDot) { return print(pNumber, pDigSep, pDigGrSep, pDecPlAfDot, 3); }
public void persist() throws Exception { srvPersist.persist(projectUml); makeClassloader(); }
public void restore() throws Exception { srvPersist.restore(projectUml); makeClassloader(); }
public EditorClassFull(DLI dli, SrvEditClassFull<CL, DLI> srvEdit) { super(dli, srvEdit, srvEdit.getSrvI18n().getMsg("class")); }
/** * <p> * Read entity attributes from stream. * </p> * @param pAddParam additional params * @param pReader reader. * @return attributes map * @throws Exception - an exception **/ @Override public final Map<String, String> readAttributes( final Map<String, Object> pAddParam, final Reader pReader) throws Exception { return this.utilXml.readAttributes(pReader, pAddParam); }
@Override public void persist(P p, FileAndWriter pi) throws Exception { srvPersistShape.persist(p.getShape(), pi); }
/** * <p>Retrieve setter from given class by field name.</p> * @param pClazz - class * @param pFieldName - field name * @return Method setter. * @throws Exception if method not exist **/ @Override public final Method retrieveSetterForField(final Class<?> pClazz, final String pFieldName) throws Exception { String setterName = "set" + pFieldName.substring(0, 1).toUpperCase() + pFieldName.substring(1); return retrieveMethod(pClazz, setterName); } }