/** * <p>Retrieve a list of all entities.</p> * @param pAddParam additional param * @return list of all business objects * @throws Exception - an exception */ @Override public final List<AccSettings> retrieveList( final Map<String, Object> pAddParam) throws Exception { return getSrvOrm().retrieveList(this.entityClass); }
/** * <p>Refresh entity from DB by given entity with ID.</p> * @param pEntity entity * @return entity or null * @throws Exception - an exception **/ @Override public final synchronized AccSettings retrieveEntity( final Map<String, Object> pAddParam, final AccSettings pEntity) throws Exception { return lazyGetAccSettings(); }
/** * <p>Retrieve/get Accounting settings.</p> * @return Accounting settings * @throws Exception - an exception **/ @Override public final synchronized AccSettings lazyGetAccSettings() throws Exception { if (this.accSettings == null) { retrieveAccSettings(); } return this.accSettings; }
"precision_must_be_from_0_to_4"); getSrvOrm().updateEntity(pEntity); retrieveAccSettings();
/** * <p>Get SrvAccSettings in lazy mode.</p> * @return SrvAccSettings - SrvAccSettings * @throws Exception - an exception */ public final SrvAccSettings<RS> lazyGetSrvAccSettings() throws Exception { String beanName = getSrvAccSettingsName(); @SuppressWarnings("unchecked") SrvAccSettings<RS> srvAccSettings = (SrvAccSettings<RS>) this.factoryAppBeans.getBeansMap().get(beanName); if (srvAccSettings == null) { srvAccSettings = new SrvAccSettings<RS>(this.factoryAppBeans.lazyGetSrvOrm()); this.factoryAppBeans.getBeansMap().put(beanName, srvAccSettings); this.factoryAppBeans.lazyGetLogger().info(null, FactoryAccServices.class, beanName + " has been created."); } return srvAccSettings; }
"precision_must_be_from_0_to_4"); getSrvOrm().updateEntity(pAddParam, pEntity); retrieveAccSettings(pAddParam);
/** * <p>Get SrvAccSettings in lazy mode.</p> * @return SrvAccSettings - SrvAccSettings * @throws Exception - an exception */ public final synchronized SrvAccSettings lazyGetSrvAccSettings() throws Exception { if (this.srvAccSettings == null) { this.srvAccSettings = new SrvAccSettings(factoryAppBeans.lazyGetSrvOrm()); this.factoryAppBeans.getBeansMap().put("srv" + AccEntriesSourcesLine .class.getSimpleName(), new SrvAccSettingsLine<AccEntriesSourcesLine, AccSettings>(AccEntriesSourcesLine.class, AccSettings.class, factoryAppBeans.lazyGetSrvOrm(), lazyGetSrvAccSettings())); this.factoryAppBeans.getBeansMap().put("srv" + CogsItemSourcesLine .class.getSimpleName(), new SrvAccSettingsLine<CogsItemSourcesLine, AccSettings>( CogsItemSourcesLine.class, AccSettings.class, factoryAppBeans.lazyGetSrvOrm(), lazyGetSrvAccSettings())); this.factoryAppBeans.getBeansMap().put("srv" + DrawMaterialSourcesLine .class.getSimpleName(), new SrvAccSettingsLine<DrawMaterialSourcesLine, AccSettings>( DrawMaterialSourcesLine.class, AccSettings.class, factoryAppBeans.lazyGetSrvOrm(), lazyGetSrvAccSettings())); } return this.srvAccSettings; }
/** * <p>Retrieve entity from DB by given ID.</p> * @param pAddParam additional param * @param pId ID * @return entity or null * @throws Exception - an exception **/ @Override public final synchronized AccSettings retrieveEntityById( final Map<String, Object> pAddParam, final Object pId) throws Exception { return lazyGetAccSettings(); }
/** * <p>Retrieve a page of entities.</p> * @param pAddParam additional param * @param pFirst number of the first record * @param pPageSize page size (max records) * @return list of business objects * @throws Exception - an exception */ @Override public final List<AccSettings> retrievePage( final Map<String, Object> pAddParam, final Integer pFirst, final Integer pPageSize) throws Exception { return getSrvOrm().retrievePage(this.entityClass, pFirst, pPageSize); }
/** * <p>Retrieve/get Accounting settings.</p> * @param pAddParam additional param * @return Accounting settings * @throws Exception - an exception **/ @Override public final synchronized AccSettings lazyGetAccSettings( final Map<String, Object> pAddParam) throws Exception { if (this.accSettings == null) { retrieveAccSettings(pAddParam); } return this.accSettings; }
SrvAccSettings srvAccSettings = (SrvAccSettings) this.factoryAppBeans .lazyGet("srvAccSettings"); pReq.setAttribute("accSettings", srvAccSettings.lazyGetAccSettings()); rd.include(pReq, pResp); } catch (Exception e) {
/** * <p>Retrieve a list of entities.</p> * @param pAddParam additional param * @param pQueryConditions Not NULL e.g. "where name='U1' ORDER BY id" * or "where ITSDATE>21313211 order by ITSID" * @return list of business objects * @throws Exception - an exception */ @Override public final List<AccSettings> retrieveListWithConditions( final Map<String, Object> pAddParam, final String pQueryConditions) throws Exception { return getSrvOrm() .retrieveListWithConditions(this.entityClass, pQueryConditions); }
SrvAccSettings srvAccSettings = (SrvAccSettings) this.factoryAppBeans .lazyGet("srvAccSettings"); pReq.setAttribute("accSettings", srvAccSettings.lazyGetAccSettings()); rd.include(pReq, pResp); } catch (Exception e) {
/** * <p>Retrieve a page of entities.</p> * @param pAddParam additional param * @param pQueryConditions Not NULL e.g. "where name='U1' ORDER BY id" * @param pFirst number of the first record * @param pPageSize page size (max records) * @return list of business objects * @throws Exception - an exception */ @Override public final List<AccSettings> retrievePageWithConditions( final Map<String, Object> pAddParam, final String pQueryConditions, final Integer pFirst, final Integer pPageSize) throws Exception { return getSrvOrm().retrievePageWithConditions(this.entityClass, pQueryConditions, pFirst, pPageSize); } /**
SrvAccSettings srvAccSettings = (SrvAccSettings) this.factoryAppBeans .lazyGet("srvAccSettings"); pReq.setAttribute("accSettings", srvAccSettings.lazyGetAccSettings()); rd.include(pReq, pResp); } catch (Exception e) {
/** * <p>Retrieve Accounting settings from database.</p> * @throws Exception - an exception **/ public final synchronized void retrieveAccSettings() throws Exception { this.accSettings = getSrvOrm().retrieveEntityById(this.entityClass, 1L); if (this.accSettings == null) { throw new ExceptionWithCode(ExceptionWithCode.CONFIGURATION_MISTAKE, "There is no accounting settings!!!"); } List<DrawMaterialSourcesLine> drawMaterialSources = getSrvOrm() .retrieveEntityOwnedlist(DrawMaterialSourcesLine.class, AccSettings.class, 1L); this.accSettings.setDrawMaterialSources(drawMaterialSources); List<CogsItemSourcesLine> cogsItemSources = getSrvOrm() .retrieveEntityOwnedlist(CogsItemSourcesLine.class, AccSettings.class, 1L); this.accSettings.setCogsItemSources(cogsItemSources); List<AccEntriesSourcesLine> accEntriesSources = getSrvOrm() .retrieveEntityOwnedlist(AccEntriesSourcesLine.class, AccSettings.class, 1L); this.accSettings.setAccEntriesSources(accEntriesSources); }
SrvAccSettings srvAccSettings = (SrvAccSettings) this.factoryAppBeans .lazyGet("srvAccSettings"); pReq.setAttribute("accSettings", srvAccSettings.lazyGetAccSettings()); rd.include(pReq, pResp); } catch (Exception e) {
/** * <p>Retrieve Accounting settings from database.</p> * @param pAddParam additional param * @throws Exception - an exception **/ public final synchronized void retrieveAccSettings( final Map<String, Object> pAddParam) throws Exception { this.accSettings = new AccSettings(); this.accSettings.setItsId(1L); this.accSettings = getSrvOrm().retrieveEntity(pAddParam, this.accSettings); if (this.accSettings == null) { throw new ExceptionWithCode(ExceptionWithCode.CONFIGURATION_MISTAKE, "There is no accounting settings!!!"); } DrawMaterialSourcesLine dmsl = new DrawMaterialSourcesLine(); dmsl.setItsOwner(this.accSettings); List<DrawMaterialSourcesLine> drawMaterialSources = getSrvOrm() .retrieveListForField(pAddParam, dmsl, "itsOwner"); this.accSettings.setDrawMaterialSources(drawMaterialSources); CogsItemSourcesLine cisl = new CogsItemSourcesLine(); cisl.setItsOwner(this.accSettings); List<CogsItemSourcesLine> cogsItemSources = getSrvOrm() .retrieveListForField(pAddParam, cisl, "itsOwner"); this.accSettings.setCogsItemSources(cogsItemSources); AccEntriesSourcesLine aesl = new AccEntriesSourcesLine(); aesl.setItsOwner(this.accSettings); List<AccEntriesSourcesLine> accEntriesSources = getSrvOrm() .retrieveListForField(pAddParam, aesl, "itsOwner"); this.accSettings.setAccEntriesSources(accEntriesSources); }
SrvAccSettings srvAccSettings = (SrvAccSettings) this.factoryAppBeans .lazyGet("srvAccSettings"); pReq.setAttribute("accSettings", srvAccSettings.lazyGetAccSettings()); pReq.setAttribute("srvI18n", srvI18n); pReq.setAttribute("accounts", accountsInChart);