TableOnConditionStep<Record> joinPointPermissions(Table<Record> table, Field<Integer> dataPointIdField, User user) { Condition userHasPermission = DataPointDao.getInstance().userHasPermission(user); return table .join(DataPointDao.DATA_POINTS).on(dataPointIdField.eq(DataPointDao.ID)) .join(DataSourceDao.DATA_SOURCES).on(DSL.and(DataPointDao.DATA_SOURCE_ID.eq(DataSourceDao.ID), userHasPermission)); }
for (String key : request.annotations) { ZipkinAnnotations aTable = ZIPKIN_ANNOTATIONS.as("a" + i++); table = maybeOnService(table.join(aTable) .on(schema.joinCondition(aTable)) .and(aTable.A_KEY.eq(key)), aTable, request.serviceName); table = maybeOnService(table.join(aTable) .on(schema.joinCondition(aTable)) .and(aTable.A_TYPE.eq(STRING.value))