/** * Dynamic Init * * @param value value * @param whereClause where clause */ private void initInfo(String value, String whereClause) { // C_BPartner bp, AD_User c, C_BPartner_Location l, C_Location a // Create Grid StringBuilder where = new StringBuilder(s_assignmentWHERE); if (whereClause != null && whereClause.length() > 0) where.append(" AND ").append(whereClause); prepareTable( s_assignmentLayout, s_assignmentFROM, where.toString(), "rt.Name,r.Name,ra.AssignDateFrom"); } // initInfo
/** * Get dynamic WHERE part of SQL To be overwritten by concrete classes * * @return WHERE clause */ protected String getSQLWhere() { StringBuilder sql = new StringBuilder(); Integer S_ResourceType_ID = (Integer) fieldResourceType.getValue(); if (S_ResourceType_ID != null) sql.append(" AND rt.S_ResourceType_ID=").append(S_ResourceType_ID.intValue()); Integer S_Resource_ID = (Integer) fieldResource.getValue(); if (S_Resource_ID != null) sql.append(" AND r.S_Resource_ID=").append(S_Resource_ID.intValue()); Date f = fieldFrom.getValue(); Timestamp ts = f != null ? new Timestamp(f.getTime()) : null; if (ts != null) sql.append(" AND TRUNC(ra.AssignDateFrom)>=").append(DB.TO_DATE(ts, false)); Date t = fieldTo.getValue(); ts = t != null ? new Timestamp(t.getTime()) : null; if (ts != null) sql.append(" AND TRUNC(ra.AssignDateTo)<=").append(DB.TO_DATE(ts, false)); return sql.toString(); } // getSQLWhere