Example usage for org.hibernate FlushMode MANUAL

List of usage examples for org.hibernate FlushMode MANUAL

Introduction

In this page you can find the example usage for org.hibernate FlushMode MANUAL.

Prototype

FlushMode MANUAL

To view the source code for org.hibernate FlushMode MANUAL.

Click Source Link

Document

The Session is only ever flushed when Session#flush is explicitly called by the application.

Usage

From source file:org.egov.egf.web.actions.report.ExpenseJournalVoucherPrintAction.java

License:Open Source License

private void populateVoucher() {
    persistenceService.getSession().setDefaultReadOnly(true);
    persistenceService.getSession().setFlushMode(FlushMode.MANUAL);
    if (!StringUtils.isBlank(parameters.get("id")[0])) {
        final Long id = Long.valueOf(parameters.get("id")[0]);
        final CVoucherHeader voucherHeader = persistenceService.getSession().get(CVoucherHeader.class, id);
        if (voucherHeader != null) {
            voucher = voucherHeader;//from w ww.j a va 2 s  . c o m
            billRegistermis = (EgBillregistermis) persistenceService
                    .find("from EgBillregistermis where voucherHeader.id=?", voucherHeader.getId());
            if (billRegistermis != null)
                persistenceService.findAllBy(
                        "from EgBillPayeedetails where egBilldetailsId.egBillregister.id=?",
                        billRegistermis.getEgBillregister().getId());
            generateVoucherReportList();
        }
    }
}

From source file:org.egov.egf.web.actions.report.FunctionwiseIEAction.java

License:Open Source License

@Override
public void prepare() {
    persistenceService.getSession().setDefaultReadOnly(true);
    persistenceService.getSession().setFlushMode(FlushMode.MANUAL);
    super.prepare();
    if (reportSearch.getStartDate() == null || reportSearch.getStartDate().equals(""))
        reportSearch.setStartDate(sdf.format(((CFinancialYear) persistenceService
                .find(" from CFinancialYear where startingDate <= '" + formatter.format(new Date())
                        + "' and endingDate >= '" + formatter.format(new Date()) + "'")).getStartingDate()));
    if (reportSearch.getEndDate() == null || reportSearch.getEndDate().equals(""))
        reportSearch.setEndDate(sdf.format(new Date()));
    setTodayDate(new Date());
}

From source file:org.egov.egf.web.actions.report.FundFlowManualEntryReportAction.java

License:Open Source License

@Override
public void prepare() {
    persistenceService.getSession().setDefaultReadOnly(true);
    persistenceService.getSession().setFlushMode(FlushMode.MANUAL);
    super.prepare();
    addDropdownData("fundList", masterDataCache.get("egi-fund"));
    addDropdownData("bankList", Collections.EMPTY_LIST);
    addDropdownData("accNumList", Collections.EMPTY_LIST);
}

From source file:org.egov.egf.web.actions.report.GeneralLedgerReportAction.java

License:Open Source License

@Validations(requiredFields = {
        @RequiredFieldValidator(fieldName = "glCode1", message = "", key = FinancialConstants.REQUIRED),
        @RequiredFieldValidator(fieldName = "fund_id", message = "", key = FinancialConstants.REQUIRED),
        @RequiredFieldValidator(fieldName = "startDate", message = "", key = FinancialConstants.REQUIRED),
        @RequiredFieldValidator(fieldName = "endDate", message = "", key = FinancialConstants.REQUIRED) })
@ValidationErrorPage(value = FinancialConstants.STRUTS_RESULT_PAGE_SEARCH)
@SkipValidation/*ww w . j  a v  a 2 s . c  o  m*/
@Action(value = "/report/generalLedgerReport-ajaxSearch")
@ReadOnly
public String ajaxSearch() {

    persistenceService.getSession().setDefaultReadOnly(true);
    persistenceService.getSession().setFlushMode(FlushMode.MANUAL);
    try {
        generalLedgerDisplayList = generalLedgerReport.getGeneralLedgerList(generalLedgerReportBean);
    } catch (Exception e) {
        LOGGER.error("Error while getting General Ledger", e);
    }
    heading = getGLHeading();
    generalLedgerReportBean.setHeading(getGLHeading());
    prepareNewForm();
    return "results";
}

From source file:org.egov.egf.web.actions.report.GeneralLedgerReportAction.java

License:Open Source License

@Action(value = "/report/generalLedgerReport-searchDrilldown")
public String searchDrilldown() {
    persistenceService.getSession().setDefaultReadOnly(true);
    persistenceService.getSession().setFlushMode(FlushMode.MANUAL);
    try {/*  w ww. j a  va2  s .  c  o m*/
        generalLedgerDisplayList = generalLedgerReport.getGeneralLedgerList(generalLedgerReportBean);
    } catch (Exception e) {
        LOGGER.error("Error while getting General Ledger", e);
    }
    heading = getGLHeading();
    generalLedgerReportBean.setHeading(getGLHeading());
    prepareNewForm();
    return "searchResult";
}

From source file:org.egov.egf.web.actions.report.IncomeExpenditureReportAction.java

License:Open Source License

@Override
public void prepare() {
    persistenceService.getSession().setDefaultReadOnly(true);
    persistenceService.getSession().setFlushMode(FlushMode.MANUAL);
    super.prepare();
    if (!parameters.containsKey("showDropDown")) {
        addDropdownData("departmentList", masterDataCache.get("egi-department"));
        addDropdownData("functionList", masterDataCache.get("egi-function"));
        addDropdownData("functionaryList", masterDataCache.get("egi-functionary"));
        addDropdownData("fundDropDownList", masterDataCache.get("egi-fund"));
        addDropdownData("fieldList", masterDataCache.get("egi-ward"));
        addDropdownData("financialYearList", getPersistenceService()
                .findAllBy("from CFinancialYear where isActive=true  order by finYearRange desc "));
    }//from  w w  w  .  j a  va 2  s . c  om
}

From source file:org.egov.egf.web.actions.report.OpeningBalanceReportAction.java

License:Open Source License

public void prepareNewForm() {
    super.prepare();
    persistenceService.getSession().setDefaultReadOnly(true);
    persistenceService.getSession().setFlushMode(FlushMode.MANUAL);
    addDropdownData("fundList",
            persistenceService.findAllBy(" from Fund where isactive=true and isnotleaf=false order by name"));
    addDropdownData("departmentList", persistenceService.findAllBy("from Department order by name"));
    addDropdownData("financialYearList",
            persistenceService.findAllBy("from CFinancialYear order by finYearRange desc "));

    if (LOGGER.isDebugEnabled())
        LOGGER.debug("Inside  Prepare ........");

}

From source file:org.egov.egf.web.actions.report.PendingTDSReportAction.java

License:Open Source License

@Override
public void prepare() {
    persistenceService.getSession().setDefaultReadOnly(true);
    persistenceService.getSession().setFlushMode(FlushMode.MANUAL);
    super.prepare();
    addDropdownData("departmentList", persistenceService.findAllBy("from Department order by name"));
    addDropdownData("fundList",
            persistenceService.findAllBy(" from Fund where isactive=true and isnotleaf=false order by name"));

    addDropdownData("recoveryList",
            persistenceService.findAllBy(" from Recovery where isactive=true order by chartofaccounts.glcode"));
}

From source file:org.egov.egf.web.actions.report.ReportAction.java

License:Open Source License

@Override
public void prepare() {
    persistenceService.getSession().setDefaultReadOnly(true);
    persistenceService.getSession().setFlushMode(FlushMode.MANUAL);
    super.prepare();
    getHeaderFields();//  ww  w  .jav  a 2 s .c o  m
    if (headerFields.contains(Constants.DEPARTMENT))
        addDropdownData("departmentList", persistenceService.findAllBy("from Department order by name"));
    if (headerFields.contains(Constants.FUNCTION))
        addDropdownData("functionList", persistenceService
                .findAllBy("from CFunction where isactive=true and isnotleaf=false  order by name"));
    if (headerFields.contains(Constants.FUNCTIONARY))
        addDropdownData("functionaryList",
                persistenceService.findAllBy(" from Functionary where isactive=true order by name"));
    if (headerFields.contains(Constants.FUND))
        addDropdownData("fundList", persistenceService
                .findAllBy(" from Fund where isactive=true and isnotleaf=false order by name"));
    if (headerFields.contains(Constants.FUNDSOURCE))
        addDropdownData("fundsourceList",
                persistenceService.findAllBy(" from Fundsource where isactive=true order by name"));
    if (headerFields.contains(Constants.FIELD))
        addDropdownData("fieldList",
                persistenceService.findAllBy(" from Boundary b where lower(b.boundaryType.name)='ward' "));
    if (headerFields.contains(Constants.SCHEME))
        addDropdownData("schemeList", Collections.EMPTY_LIST);
    if (headerFields.contains(Constants.SUBSCHEME))
        addDropdownData("subschemeList", Collections.EMPTY_LIST);
}

From source file:org.egov.egf.web.actions.report.RtgsIssueRegisterReportAction.java

License:Open Source License

@Override
public void prepare() {
    persistenceService.getSession().setDefaultReadOnly(true);
    persistenceService.getSession().setFlushMode(FlushMode.MANUAL);
    super.prepare();

    addDropdownData("bankList",
            persistenceService.findAllBy("from Bank where isactive=true order by upper(name)"));
    addDropdownData("bankBranchList", Collections.EMPTY_LIST);
    addDropdownData("bankAccountList", Collections.EMPTY_LIST);
    addDropdownData("accNumList", Collections.EMPTY_LIST);
    addDropdownData("chequeNumberList", Collections.EMPTY_LIST);
    finYearDate();//from   www  .j  a  v  a 2s .c o  m
    mandatoryFields.clear();

}