@Override public List<CTLSchemaDto> findCtlSchemaDependents(String schemaId) { validateSqlId(schemaId, "Incorrect schema id for ctl schema request."); LOG.debug("Find dependents schemas for schema with id [{}]", schemaId); List<CTLSchemaDto> list = Collections.emptyList(); CtlSchema schemaDto = ctlSchemaDao.findById(schemaId); if (schemaDto != null) { list = convertDtoList(ctlSchemaDao.findDependentSchemas(schemaDto.getStringId())); } return list; }
@Override public List<CTLSchemaDto> findCtlSchemaDependents(String fqn, Integer version, String tenantId, String applicationId) { if (isBlank(fqn) || version == null) { throw new IncorrectParameterException("Incorrect parameters for ctl schema request."); } LOG.debug("Find dependents schemas for schema with fqn {} version {}, tenantId {} and " + "applicationId ()", fqn, version, tenantId, applicationId); List<CTLSchemaDto> schemas = Collections.emptyList(); CtlSchema schema = ctlSchemaDao.findByFqnAndVerAndTenantIdAndApplicationId(fqn, version, tenantId, applicationId); if (schema != null) { schemas = convertDtoList(ctlSchemaDao.findDependentSchemas(schema.getStringId())); } return schemas; }
if (ctlSchema != null) { List<CtlSchema> dependsList = ctlSchemaDao.findDependentSchemas(ctlSchema.getStringId()); if (dependsList.isEmpty()) { synchronized (this) { ctlSchemaMetaInfoDao.lockRequest(lockOptions).setScope(true).lock(metaInfo); try { ctlSchemaDao.removeById(ctlSchema.getStringId()); List<CtlSchema> schemas = ctlSchemaDao.findAllByMetaInfoId(metaInfo.getStringId()); if (schemas == null || schemas.isEmpty()) {
@Override public CTLSchemaDto toDto() { CTLSchemaDto ctlSchemaDto = createDto(); ctlSchemaDto.setId(getStringId()); ctlSchemaDto.setMetaInfo(metaInfo.toDto()); ctlSchemaDto.setVersion(version); ctlSchemaDto.setCreatedTime(createdTime); ctlSchemaDto.setCreatedUsername(createdUsername); ctlSchemaDto.setBody(body); ctlSchemaDto.setDefaultRecord(defaultRecord); ctlSchemaDto.setDependencySet(DaoUtil.convertDtoSet(dependencySet)); return ctlSchemaDto; }
@Override public T toDto() { T dto = createDto(); dto.setId(getStringId()); if (application != null) { dto.setApplicationId(application.getStringId()); } if (ctlSchema != null) { dto.setCtlSchemaId(ctlSchema.getStringId()); } dto.setVersion(version); dto.setName(name); dto.setDescription(description); dto.setCreatedUsername(createdUsername); dto.setCreatedTime(createdTime); return dto; }
@Override public EventClassDto toDto() { EventClassDto dto = createDto(); dto.setId(getStringId()); if (tenant != null) { dto.setTenantId(tenant.getStringId()); } if (ecfv != null) { dto.setEcfvId(ecfv.getStringId()); } dto.setFqn(fqn); dto.setType(type); dto.setCreatedUsername(createdUsername); dto.setCreatedTime(createdTime); dto.setDescription(description); dto.setName(name); dto.setVersion(version); dto.setCtlSchemaId(getCtlSchema().getStringId()); return dto; }