Beispiel #1
0
 @Override
 protected String createQueryText() {
   Set<TableEJBQLFieldDef> fieldDefs =
       ((DefaultMaintenanceEJBQLTableModel) table.getModel()).getFieldDefsSet();
   String fieldsList = DatabaseUtils.generateEJBQLSelectClause(fieldDefs);
   return String.format(LOAD_BROWSE_EJBQL, fieldsList);
 }
  /* (non-Javadoc)
   * @see com.mg.framework.generic.ui.DefaultPlainBrowseForm#createQueryText()
   */
  @Override
  protected String createQueryText() {
    super.createQueryText();
    fieldDefs = ((WarehouseDocModelMaintenanceEJBQLTableModel) table.getModel()).getFieldDefsSet();
    String fieldsList = DatabaseUtils.generateEJBQLSelectClause(fieldDefs);
    String fromList = DatabaseUtils.generateEJBQLFromClause(fieldDefs);

    return String.format(INIT_QUERY_TEXT, fieldsList, fromList, whereText);
  }
 /* (non-Javadoc)
  * @see com.mg.framework.generic.ui.DefaultPlainBrowseForm#createQueryText()
  */
 @Override
 protected String createQueryText() {
   Set<TableEJBQLFieldDef> fieldDefs =
       ((DefaultMaintenanceEJBQLTableModel) table.getModel()).getFieldDefsSet();
   String fieldsList = DatabaseUtils.generateEJBQLSelectClause(fieldDefs);
   String fromList = DatabaseUtils.generateEJBQLFromClause(fieldDefs);
   return String.format(
       INIT_QUERY_TEXT, fieldsList, fromList, ServerUtils.getUserProfile().getGroupsCommaText());
 }
 /* (non-Javadoc)
  * @see com.mg.framework.generic.ui.DefaultPlainBrowseForm#createQueryText()
  */
 @Override
 protected String createQueryText() {
   super.createQueryText();
   Set<TableEJBQLFieldDef> fieldDefs =
       ((ManufactureDocumentMaintenanceEJBQLTableModel) table.getModel()).getFieldDefsSet();
   fieldsList = DatabaseUtils.generateEJBQLSelectClause(fieldDefs);
   fromList = DatabaseUtils.generateEJBQLFromClause(fieldDefs);
   restDocument = (VarianceDocumentHeadRest) getRestrictionForm();
   whereText
       .append(
           DatabaseUtils.formatEJBQLObjectRestriction(
               "d.SrcMol",
               restDocument.getSrcMolCode(),
               "srcdstMolCode",
               paramsName,
               paramsValue,
               false))
       .append(
           DatabaseUtils.formatEJBQLObjectRestriction(
               "d.SrcStock",
               restDocument.getSrcStockCode(),
               "srcStockCode",
               paramsName,
               paramsValue,
               false))
       .append(
           DatabaseUtils.formatEJBQLObjectRestriction(
               "d.From", restDocument.getFromCode(), "fromCode", paramsName, paramsValue, false))
       .append(
           DatabaseUtils.formatEJBQLObjectRestriction(
               "d.To", restDocument.getToCode(), "toCode", paramsName, paramsValue, false))
       .append(
           DatabaseUtils.formatEJBQLObjectRestriction(
               "d.Job", restDocument.getJob(), "job", paramsName, paramsValue, false))
       .append(
           DatabaseUtils.formatEJBQLObjectRestriction(
               "d.WC", restDocument.getWorkCenter(), "wcCode", paramsName, paramsValue, false));
   if (whereText.indexOf("Catalog") != -1) {
     fromList = (", VarianceDocumentSpec as ds ").concat(fromList);
   }
   return String.format(INIT_QUERY_TEXT, fieldsList, fromList, whereText.toString());
 }
  /* (non-Javadoc)
   * @see com.mg.framework.generic.ui.DefaultPlainBrowseForm#createQueryText()
   */
  @Override
  protected String createQueryText() {
    String whereText = ""; // $NON-NLS-1$
    Set<TableEJBQLFieldDef> fieldDefs =
        ((DefaultMaintenanceEJBQLTableModel) table.getModel()).getFieldDefsSet();
    String fieldsList = DatabaseUtils.generateEJBQLSelectClause(fieldDefs);
    String fromList = DatabaseUtils.generateEJBQLFromClause(fieldDefs);
    paramsName.clear();
    paramsValue.clear();
    StaffListPositionRest restForm = (StaffListPositionRest) getRestrictionForm();
    whereText =
        " where "
            .concat(
                DatabaseUtils.formatEJBQLHierarchyRestriction(
                    ((HierarchyRestrictionSupport) restForm).isUseHierarchy(),
                    "sp.StaffListUnit",
                    6,
                    "folder",
                    folderEntity,
                    paramsName,
                    paramsValue,
                    true))
            . //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
            concat(
                DatabaseUtils.formatEJBQLObjectRestriction(
                    "sp.Position",
                    restForm.getPositionName(),
                    "positionName",
                    paramsName,
                    paramsValue,
                    false))
            . //$NON-NLS-1$ //$NON-NLS-2$
            concat(
                DatabaseUtils.formatEJBQLObjectRestriction(
                    "sp.StaffCategory",
                    restForm.getStaffCategoryCode(),
                    "staffCategoryCode",
                    paramsName,
                    paramsValue,
                    false))
            . //$NON-NLS-1$ //$NON-NLS-2$
            concat(
                DatabaseUtils.formatEJBQLObjectRangeRestriction(
                    "sp.BeginDate",
                    restForm.getBeginDate(),
                    restForm.getEndDate(),
                    "beginDate",
                    "endDate",
                    paramsName,
                    paramsValue,
                    false))
            . //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
            concat(
                DatabaseUtils.formatEJBQLObjectRangeRestriction(
                    "sp.EndDate",
                    restForm.getBeginDate(),
                    restForm.getEndDate(),
                    "beginDate",
                    "endDate",
                    paramsName,
                    paramsValue,
                    false))
            . //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
            concat(
                DatabaseUtils.formatEJBQLObjectRestriction(
                    "sp.WorkSchedule",
                    restForm.getWorkScheduleCode(),
                    "workScheduleCode",
                    paramsName,
                    paramsValue,
                    false))
            . //$NON-NLS-1$ //$NON-NLS-2$
            concat(
                DatabaseUtils.formatEJBQLObjectRestriction(
                    "sp.WorkCondition",
                    restForm.getWorkConditionCode(),
                    "workConditionCode",
                    paramsName,
                    paramsValue,
                    false))
            . //$NON-NLS-1$ //$NON-NLS-2$
            concat(
                DatabaseUtils.formatEJBQLObjectRestriction(
                    "sp.TaxCalcKind",
                    restForm.getTaxCalcKindCode(),
                    "taxCalcKindCode",
                    paramsName,
                    paramsValue,
                    false))
            . //$NON-NLS-1$ //$NON-NLS-2$
            concat(
                DatabaseUtils.formatEJBQLObjectRestriction(
                    "sp.CostsAnl1",
                    restForm.getAnlCode1(),
                    "anlCode1",
                    paramsName,
                    paramsValue,
                    false))
            . //$NON-NLS-1$ //$NON-NLS-2$
            concat(
                DatabaseUtils.formatEJBQLObjectRestriction(
                    "sp.CostsAnl2",
                    restForm.getAnlCode2(),
                    "anlCode2",
                    paramsName,
                    paramsValue,
                    false))
            . //$NON-NLS-1$ //$NON-NLS-2$
            concat(
                DatabaseUtils.formatEJBQLObjectRestriction(
                    "sp.CostsAnl3",
                    restForm.getAnlCode3(),
                    "anlCode3",
                    paramsName,
                    paramsValue,
                    false))
            . //$NON-NLS-1$ //$NON-NLS-2$
            concat(
                DatabaseUtils.formatEJBQLObjectRestriction(
                    "sp.CostsAnl4",
                    restForm.getAnlCode4(),
                    "anlCode4",
                    paramsName,
                    paramsValue,
                    false))
            . //$NON-NLS-1$ //$NON-NLS-2$
            concat(
                DatabaseUtils.formatEJBQLObjectRestriction(
                    "sp.CostsAnl5",
                    restForm.getAnlCode5(),
                    "anlCode5",
                    paramsName,
                    paramsValue,
                    false))
            . //$NON-NLS-1$ //$NON-NLS-2$
            concat(
                DatabaseUtils.formatEJBQLObjectRestriction(
                    "tar.Category",
                    restForm.getTariffingCategoryCode(),
                    "tariffingCategoryCode",
                    paramsName,
                    paramsValue,
                    false))
            . //$NON-NLS-1$ //$NON-NLS-2$
            concat(
                DatabaseUtils.formatEJBQLObjectRangeRestriction(
                    "tar.BeginDate",
                    restForm.getBeginDateTC(),
                    restForm.getEndDateTC(),
                    "beginDateTC",
                    "endDateTC",
                    paramsName,
                    paramsValue,
                    false))
            . //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
            concat(
                DatabaseUtils.formatEJBQLObjectRangeRestriction(
                    "tar.EndDate",
                    restForm.getBeginDateTC(),
                    restForm.getEndDateTC(),
                    "beginDateTC",
                    "endDateTC",
                    paramsName,
                    paramsValue,
                    false))
            . //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
            concat(
                DatabaseUtils.formatEJBQLObjectRangeRestriction(
                    "tar.RateOfSalary",
                    restForm.getMinSalaryFrom(),
                    restForm.getMinSalaryTill(),
                    "minSalaryFrom",
                    "minSalaryTill",
                    paramsName,
                    paramsValue,
                    false))
            . //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
            concat(
                DatabaseUtils.formatEJBQLAddinFieldsRestriction(
                    service, "sp.Id", restForm.getAddinFieldsRestriction(), false)); // $NON-NLS-1$

    if (whereText.contains("tar.")) { // $NON-NLS-1$
      whereText =
          whereText.concat(
              " and tar.StaffList = sp.StaffListUnit.StaffList and tar.SlPositionUniqueId = sp.SlPositionUniqueId"); //$NON-NLS-1$
      fromList = (", Tariffing tar ").concat(fromList); // $NON-NLS-1$
    }
    return String.format(INIT_QUERY_TEXT, fieldsList, fromList, whereText);
  }