fieldValue = pField.toString(); if (pField instanceof String) { fieldValue = getUtilXml().escapeXml(fieldValue);
/** * <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); }
reader = new BufferedReader(new InputStreamReader(urlConnection .getInputStream(), Charset.forName("UTF-8").newDecoder())); if (!this.utilXml.readUntilStart(reader, "message")) { throw new ExceptionWithCode(ExceptionWithCode.SOMETHING_WRONG, "Wrong XML response without message tag!!!");
rField.set(pEntity, Long.valueOf(pFieldStrValue)); } else if (String.class == rField.getType()) { String unescaped = this.utilXml.unescapeXml(pFieldStrValue); rField.set(pEntity, unescaped); } else {
reader = new BufferedReader(new InputStreamReader(urlConnection .getInputStream(), Charset.forName("UTF-8").newDecoder())); if (!this.utilXml.readUntilStart(reader, "message")) { throw new ExceptionWithCode(ExceptionWithCode.SOMETHING_WRONG, "Wrong XML response without message tag!!!");
rField.set(pEntity, Long.valueOf(pFieldStrValue)); } else if (String.class == rField.getType()) { String unescaped = this.utilXml.unescapeXml(pFieldStrValue); rField.set(pEntity, unescaped); } else {
reader = new BufferedReader(new InputStreamReader(urlConnection .getInputStream(), Charset.forName("UTF-8").newDecoder())); if (!this.utilXml.readUntilStart(reader, "message")) { throw new ExceptionWithCode(ExceptionWithCode.SOMETHING_WRONG, "Wrong XML response without message tag!!!");
/** * <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); }
fieldValue = pField.toString(); if (pField instanceof String) { fieldValue = getUtilXml().escapeXml(fieldValue);
setTransactionIsolation(ISrvDatabase.TRANSACTION_READ_UNCOMMITTED); this.srvDatabase.beginTransaction(); while (this.utilXml.readUntilStart(pReader, "entity")) { Object entity = this.srvEntityReader.read(pReader, null); String nameEntitySync = this.mngSettings.getClassesSettings()
setTransactionIsolation(ISrvDatabase.TRANSACTION_READ_UNCOMMITTED); this.srvDatabase.beginTransaction(); while (this.utilXml.readUntilStart(pReader, "entity")) { Object entity = this.srvEntityReader.read(pAddParam, pReader); String nameEntitySync = this.mngSettings.getClassesSettings()
/** * <p> * Read entities from stream (by given reader) and insert them * into DB with no changes. DB must be emptied before coping. * </p> * @param pReader Reader * @param pAddParam additional params * @throws Exception - an exception **/ @Override public final void readAndStoreEntities(final Reader pReader, final Map<String, Object> pAddParam) 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(pReader, null); this.srvOrm.insertEntity(entity); } this.srvDatabase.commitTransaction(); } catch (Exception ex) { this.srvDatabase.rollBackTransaction(); throw ex; } finally { this.srvDatabase.releaseResources(); } }
/** * <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(); } }