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.BillRegisterReportAction.java

License:Open Source License

@ValidationErrorPage(value = "new")
public String list() throws Exception {
    persistenceService.getSession().setDefaultReadOnly(true);
    persistenceService.getSession().setFlushMode(FlushMode.MANUAL);
    if (LOGGER.isDebugEnabled())
        LOGGER.debug("BillRegisterReportAction | list | start");
    setPageSize(50);//w ww  . j a  v  a  2s . c  om
    loadDropdownData();
    validateBeforeSearch();
    search();
    formatSearchResult();
    if (LOGGER.isDebugEnabled())
        LOGGER.debug("BillRegisterReportAction | list | End");

    return NEW;
}

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

License:Open Source License

@ReadOnly
@ValidationErrorPage(value = "completeBill")
@Action(value = "/report/billRegisterReport-billSearch")
public String billSearch() throws Exception {
    persistenceService.getSession().setDefaultReadOnly(true);
    persistenceService.getSession().setFlushMode(FlushMode.MANUAL);
    if (LOGGER.isDebugEnabled())
        LOGGER.debug("BillRegisterReportAction | completeBill | start");
    isCompleteBillRegisterReport = true;
    setPageSize(50);/*from  ww w . j  av a 2 s .  co  m*/
    loadDropdownData();
    validateBeforeSearch();
    search();
    formatSearchResult();
    if (LOGGER.isDebugEnabled())
        LOGGER.debug("BillRegisterReportAction | list | End");

    return "completeBill";

}

From source file:org.egov.egf.web.actions.report.BudgetAppropriationReportAction.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("fundDropDownList", masterDataCache.get("egi-fund"));
        budgetList = persistenceService.findAllBy(
                "from Budget bud where bud.isActiveBudget=true  and bud.parent is null  order by bud.financialYear.id  desc");
        addDropdownData("budList", budgetList);

    }//from  w  w  w  . j  av  a 2s.  c  o  m
}

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

License:Open Source License

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

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

License:Open Source License

@Override
public void prepare() {
    persistenceService.getSession().setDefaultReadOnly(true);
    persistenceService.getSession().setFlushMode(FlushMode.MANUAL);
    super.prepare();
    setupDropdownsInHeader();//  ww  w. j  av a  2 s . c  o  m
}

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

License:Open Source License

@Override
public void prepare() {
    headerFields = budgetDetailConfig.getHeaderFields();
    gridFields = budgetDetailConfig.getGridFields();
    mandatoryFields = budgetDetailConfig.getMandatoryFields();
    if (isFieldMandatory(Constants.EXECUTING_DEPARTMENT))
        addRelatedEntity("executingDepartment", Department.class);
    if (isFieldMandatory(Constants.FUND))
        addRelatedEntity("fund", Fund.class);
    if (isFieldMandatory(Constants.FUNCTION))
        addRelatedEntity("function", CFunction.class);
    if (isFieldMandatory(Constants.SCHEME))
        addRelatedEntity("scheme", Scheme.class);
    if (isFieldMandatory(Constants.SUBSCHEME))
        addRelatedEntity("subscheme", SubScheme.class);
    if (isFieldMandatory(Constants.FUNCTIONARY))
        addRelatedEntity("functionary", Functionary.class);
    if (isFieldMandatory(Constants.FUNDSOURCE))
        addRelatedEntity("fundsource", Fundsource.class);
    if (isFieldMandatory(Constants.BOUNDARY))
        addRelatedEntity("boundary", Boundary.class);
    addRelatedEntity("budgetGroup", BudgetGroup.class);
    super.prepare();
    persistenceService.getSession().setDefaultReadOnly(true);
    persistenceService.getSession().setFlushMode(FlushMode.MANUAL);

    mandatoryFields = budgetDetailConfig.getMandatoryFields();
    if (!parameters.containsKey("skipPrepare")) {
        accountTypeList.add(BudgetAccountType.REVENUE_EXPENDITURE.name());
        accountTypeList.add(BudgetAccountType.REVENUE_RECEIPTS.name());
        accountTypeList.add(BudgetAccountType.CAPITAL_EXPENDITURE.name());
        accountTypeList.add(BudgetAccountType.CAPITAL_RECEIPTS.name());
        addDropdownData("accountTypeList", accountTypeList);

        dropdownData.put("budgetGroupList",
                persistenceService.findAllBy("from BudgetGroup where isActive=true order by name"));
        if (isFieldMandatory(Constants.EXECUTING_DEPARTMENT))
            addDropdownData("departmentList", persistenceService.findAllBy("from Department order by name"));
        if (isFieldMandatory(Constants.FUNCTION))
            addDropdownData("functionList", persistenceService
                    .findAllBy("from CFunction where isactive=true and isnotleaf=false  order by name"));
        if (isFieldMandatory(Constants.FUNCTIONARY))
            addDropdownData("functionaryList",
                    persistenceService.findAllBy(" from Functionary where isactive=true order by name"));
        if (isFieldMandatory(Constants.FUND))
            addDropdownData("fundList", persistenceService
                    .findAllBy(" from Fund where isactive=true and isnotleaf=false order by name"));
        if (isFieldMandatory(Constants.FIELD))
            addDropdownData("fieldList",
                    persistenceService.findAllBy(" from Boundary b where lower(b.boundaryType.name)='ward' "));
        if (isFieldMandatory(Constants.SCHEME))
            addDropdownData("schemeList", Collections.EMPTY_LIST);
        if (isFieldMandatory(Constants.SUBSCHEME))
            addDropdownData("subschemeList", Collections.EMPTY_LIST);
    }// w  w  w.j  av a  2 s  .  c  om
}

From source file:org.egov.egf.web.actions.report.ChequeIssueRegisterReportAction.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("bankList", egovCommon.getBankBranchForActiveBanks());
        addDropdownData("bankAccountList", Collections.EMPTY_LIST);
        dropdownData.put("executingDepartmentList", masterDataCache.get("egi-department"));
    }/*from   w  w w. j  a  va  2  s .  co  m*/
    populateUlbName();
}

From source file:org.egov.egf.web.actions.report.DayBookReportAction.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"));
    currentDate = formatter.format(todayDate);
    if (LOGGER.isDebugEnabled())
        LOGGER.debug("Inside  Prepare ........");

}

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

License:Open Source License

@Override
public void prepare() {
    persistenceService.getSession().setDefaultReadOnly(true);
    persistenceService.getSession().setFlushMode(FlushMode.MANUAL);
    super.prepare();
    addDropdownData("fundDropDownList", masterDataCache.get("egi-fund"));
    addDropdownData("financialYearList",
            getPersistenceService().findAllBy("from CFinancialYear where isActive=true "
                    + "  and startingDate >='01-Apr-2010' order by finYearRange desc  "));
}

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

License:Open Source License

@Validations(requiredFields = {
        @RequiredFieldValidator(fieldName = "mode", message = "", key = FinancialConstants.REQUIRED),
        @RequiredFieldValidator(fieldName = "startDate", message = "", key = FinancialConstants.REQUIRED) })
@ValidationErrorPage(value = FinancialConstants.STRUTS_RESULT_PAGE_SEARCH)
@SkipValidation/*from www .  ja  v  a 2  s.c  om*/
@Action(value = "/report/dishonoredChequeReport-ajaxSearch")
public String ajaxSearch() throws TaskFailedException {

    persistenceService.getSession().setDefaultReadOnly(true);
    persistenceService.getSession().setFlushMode(FlushMode.MANUAL);
    if (LOGGER.isDebugEnabled())
        LOGGER.debug("DishonoredChequeAction | Search | start");
    try {
        dishonoredChequeDisplayList = dishonoredCheque.getDishonoredChequeDetails(dishonoredChequeReport);
    } catch (final Exception e) {

    }
    if (LOGGER.isDebugEnabled())
        LOGGER.debug("DishonoredChequeAction | list | End");
    heading = getGLHeading();
    prepareNewForm();
    showMode = "result";
    return "results";
}