Class ModelsProvider

java.lang.Object
org.qubership.atp.dataset.db.jpa.ModelsProvider

@Service public class ModelsProvider extends Object
  • Field Details

  • Constructor Details

    • ModelsProvider

      public ModelsProvider()
  • Method Details

    • getDataSetListById

      public DataSetList getDataSetListById(UUID uuid)
    • getAttributesPageableByDslId

      public org.springframework.data.domain.Page<AttributeEntity> getAttributesPageableByDslId(UUID uuid, List<AttributeTypeName> attributeTypesToLoad, org.springframework.data.domain.Pageable pageable)
      Get pageable attributes.
      Parameters:
      uuid - dsl id
      attributeTypesToLoad - types
      pageable - page
      Returns:
      page of attribute entities.
    • getAllVisibilityAreas

      public List<VisibilityArea> getAllVisibilityAreas()
      Visibility areas without order.
    • getAllVisibilityAreasOrderedByNameAsc

      public List<VisibilityArea> getAllVisibilityAreasOrderedByNameAsc()
      Visibility areas ordered by name.
    • getAttributeById

      public Attribute getAttributeById(UUID uuid)
    • getParameterById

      @Cacheable(value="ATP_DATASETS_PARAMETER_CACHE_OS", key="#uuid") public Parameter getParameterById(UUID uuid)
    • getParameterByAttributeIdAndDataSetId

      public Parameter getParameterByAttributeIdAndDataSetId(UUID attributeId, UUID dataSetId)
      Get Parameter by constraint fields sourceId and dataSetId.
    • getDataSetById

      public DataSet getDataSetById(UUID uuid)
    • getDataSetByNameAndDataSetListId

      public List<DataSet> getDataSetByNameAndDataSetListId(String name, UUID uuid)
    • getDataSetByDataSetListId

      public List<DataSet> getDataSetByDataSetListId(UUID uuid)
    • getDatasetsByDataSetListId

      public List<DataSet> getDatasetsByDataSetListId(UUID dataSetListId)
    • getAttributesByDataSetListId

      public List<Attribute> getAttributesByDataSetListId(UUID dataSetListId)
    • getAttributesByDataSetListIdIn

      public List<Attribute> getAttributesByDataSetListIdIn(Collection<UUID> dataSetListIds)
    • getDataSetBySourceAndDataSetListId

      public List<DataSet> getDataSetBySourceAndDataSetListId(UUID sourceId, UUID datasetId)
    • getVisibilityAreaById

      public VisibilityArea getVisibilityAreaById(UUID uuid)
    • getVisibilityAreaByName

      public VisibilityArea getVisibilityAreaByName(String name)
    • createVisibilityArea

      public VisibilityArea createVisibilityArea(String name)
      New visibility area.
    • replicate

      public VisibilityArea replicate(UUID id, String name)
      New visibility area.
    • getAttribute

      public Attribute getAttribute(AbstractUuidBasedEntity entity)
      Get or create delegate by entity.
    • getAttributeKey

      public AttributeKey getAttributeKey(AbstractUuidBasedEntity entity)
      Get or create delegate by entity.
    • getAttributeKeyById

      public AttributeKey getAttributeKeyById(UUID id)
      Gets attribute key by id.
      Parameters:
      id - the id
      Returns:
      the attribute key by id
    • getByDataSetListId

      public List<AttributeKey> getByDataSetListId(UUID dataSetListId)
      Gets attribute keys by DSL id.
      Parameters:
      dataSetListId - the DSL id
      Returns:
      the attribute key by id
    • getDataSet

      public DataSet getDataSet(AbstractUuidBasedEntity entity)
      Get or create delegate by entity.
    • getDataSetList

      public DataSetList getDataSetList(AbstractUuidBasedEntity entity)
      Get or create delegate by entity.
    • getLabel

      public Label getLabel(AbstractUuidBasedEntity entity)
      Get or create delegate by entity.
    • getParameter

      public Parameter getParameter(AbstractUuidBasedEntity entity)
      Get or create delegate by entity.
    • getVisibilityArea

      public VisibilityArea getVisibilityArea(AbstractUuidBasedEntity entity)
      Get or create delegate by entity.
    • getListValue

      public ListValue getListValue(AbstractUuidBasedEntity entity)
      Get or create delegate by entity.
    • getDatasetsIdNamesPageByNameAndVaId

      public org.springframework.data.domain.Page<AbstractEntityResponse> getDatasetsIdNamesPageByNameAndVaId(String name, UUID visibilityAreaId, org.springframework.data.domain.Pageable pageable)
      Get all DS (id, name) for visibility area and filter by name.
      Parameters:
      name - for filtering DS
      visibilityAreaId - for filtering DS
      pageable - page request
      Returns:
      datasets
    • getListValueById

      public ListValue getListValueById(UUID id)
      Get or create delegate by entity.
    • getAllNamesByName

      public org.springframework.data.domain.Page<DataSetEntity> getAllNamesByName(String name, org.springframework.data.domain.Pageable pageable)
    • replicateDataSetList

      public DataSetList replicateDataSetList(UUID id, String name, UUID visibilityAreaId, UUID sourceId, UUID createdBy, Timestamp createdWhen, UUID modifiedBy, Timestamp modifiedWhen) throws DataSetServiceException
      Create data set list with requested id data set list.
      Parameters:
      id - the id
      name - the name
      visibilityAreaId - the visibility area id
      sourceId - the source id
      Returns:
      the data set list
      Throws:
      DataSetServiceException - the data set service exception
    • replicateDataSet

      public DataSet replicateDataSet(UUID id, String name, UUID dataSetListId, Long ordering, UUID sourceId, Boolean isLocked) throws DataSetServiceException
      Create data set with requested id data set.
      Parameters:
      id - the id
      name - the name
      dataSetListId - the data set list id
      sourceId - the source id
      Returns:
      the data set
      Throws:
      DataSetServiceException - the data set service exception
    • replicateAttribute

      public Attribute replicateAttribute(UUID id, String name, AttributeTypeName type, UUID dataSetListId, UUID sourceId) throws DataSetServiceException
      Replicate attribute attribute.
      Parameters:
      id - the id
      name - the name
      type - the type
      dataSetListId - the data set list id
      sourceId - the source id
      Returns:
      the attribute
      Throws:
      DataSetServiceException - the data set service exception
    • replicateParameter

      public Parameter replicateParameter(UUID id, UUID dataSetId, UUID attributeId, UUID sourceId) throws DataSetServiceException
      Replicate parameter parameter.
      Parameters:
      id - the id
      dataSetId - the data set id
      attributeId - the attribute id
      sourceId - the source id
      Returns:
      the parameter
      Throws:
      DataSetServiceException - the data set service exception
    • replicateListValue

      public ListValue replicateListValue(UUID id, String text, UUID attributeId, UUID sourceId) throws DataSetServiceException
      Replicate list value list value.
      Parameters:
      id - the id
      text - the text
      attributeId - the attribute id
      sourceId - the sourceId
      Returns:
      the list value
      Throws:
      DataSetServiceException - the data set service exception
    • replicateAttributeKey

      public AttributeKey replicateAttributeKey(UUID id, String key, UUID attributeId, UUID dataSetId, UUID dataSetListId, UUID sourceId) throws DataSetServiceException
      Replicate attribute key.
      Parameters:
      id - the id
      key - the key
      attributeId - the attribute id
      dataSetId - the data set id
      dataSetListId - the data set list id
      sourceId - the source id
      Returns:
      the attribute key
      Throws:
      DataSetServiceException - the data set service exception
    • getAttributeByNameAndDataSetListId

      public List<Attribute> getAttributeByNameAndDataSetListId(String name, UUID dataSetListId)
      Get an attribute with selected name and data set list id.
      Parameters:
      name - the name
      dataSetListId - the data set list id
      Returns:
      the by name and data set list id
    • getAttributeByDataSetListId

      public List<Attribute> getAttributeByDataSetListId(UUID dataSetListId)
      Get an attribute by data set list id.
      Parameters:
      dataSetListId - the data set list id
      Returns:
      the by data set list id
    • getAttributeBySourceAndDataSetListId

      public List<Attribute> getAttributeBySourceAndDataSetListId(UUID sourceId, UUID dataSetListId)
      Get an attribute with selected name and data set list id.
      Parameters:
      sourceId - the sourceId
      dataSetListId - the data set list id
      Returns:
      the by name and data set list id
    • getAttributeKeyBySourceAndDataSetListId

      public List<AttributeKey> getAttributeKeyBySourceAndDataSetListId(UUID sourceId, UUID dataSetListId)
      Get an attribute with selected name and data set list id.
      Parameters:
      sourceId - the sourceId
      dataSetListId - the data set list id
      Returns:
      the by name and data set list id
    • getAttributeKeyByKeyAndDataSetListIdAndDataSetIdAndAttributeId

      public AttributeKey getAttributeKeyByKeyAndDataSetListIdAndDataSetIdAndAttributeId(String key, UUID dataSetListId, UUID datasetId, UUID attributeId)
      Get an attribute with selected key and data set list id and data set id and attribute id.
      Parameters:
      key - the key
      dataSetListId - the data set list id
      datasetId - the data set id
      attributeId - the attribute id
      Returns:
      AttributeKey
    • getDataSetListByNameAndVisibilityAreaId

      public List<DataSetList> getDataSetListByNameAndVisibilityAreaId(String name, UUID visibilityArea)
      Gets data set list by name and visibility area id.
      Parameters:
      name - the name
      visibilityArea - the visibility area
      Returns:
      collection of data set list by name and data set list id
    • getDataSetListByVisibilityAreaId

      public List<DataSetList> getDataSetListByVisibilityAreaId(UUID visibilityArea)
      Gets data set list visibility are id.
      Parameters:
      visibilityArea - the visibility area
      Returns:
      collection of data set list by name and data set list id
    • getAttributesByTypeDatasetListId

      public PaginationResponse<TableResponse> getAttributesByTypeDatasetListId(UUID dataSetListId, org.springframework.data.domain.Pageable pageable)
      Get attributes by type dataset list identifier.
      Parameters:
      dataSetListId - dataset list identifier
      pageable - page request
      Returns:
      result response
    • getParametersByDatasetId

      public PaginationResponse<TableResponse> getParametersByDatasetId(UUID dataSetId, org.springframework.data.domain.Pageable pageable)
      Get parameters by type dataset identifier.
      Parameters:
      dataSetId - dataset identifier
      pageable - page request
      Returns:
      result response
    • getDataSetListBySourceIdAndVisibilityAreaId

      public List<DataSetList> getDataSetListBySourceIdAndVisibilityAreaId(UUID sourceId, UUID visibilityArea)
      Gets data set list by source id and visibility area id .
      Parameters:
      sourceId - the source id
      visibilityArea - the visibility area
      Returns:
      collection of data set list by name and data set list id
    • getDataSetListIdsBySagaSessionIdIdAndVisibilityAreaId

      public Set<UUID> getDataSetListIdsBySagaSessionIdIdAndVisibilityAreaId(UUID sagaSessionId, UUID visibilityAreaId)
      Gets data set lists by saga session id and visibility area id.
      Used in saga transactions.
      Parameters:
      sagaSessionId - the saga session id
      visibilityAreaId - the visibility area id
      Returns:
      collection of data set list
    • getParameterBySourceIdAndDataSetId

      public List<Parameter> getParameterBySourceIdAndDataSetId(UUID sourceId, UUID datasetId)
      Gets parameter by source id and dataset id.
      Parameters:
      sourceId - the source id
      datasetId - the visibility area
      Returns:
      collection of parameters
    • getSortedParameterByDataSetId

      public List<Parameter> getSortedParameterByDataSetId(UUID datasetId)
    • getSortedOverlapParametersByDataSetId

      public List<Parameter> getSortedOverlapParametersByDataSetId(UUID datasetId)
    • getListValueBySourceIdAndAttrId

      public List<ListValue> getListValueBySourceIdAndAttrId(UUID sourceId, UUID attributeId)
      Gets list value by source id and dataset id.
      Parameters:
      sourceId - the source id
      attributeId - the attribute id
      Returns:
      collection of list values
    • getByAttributeIdAndText

      public ListValue getByAttributeIdAndText(UUID attributeId, String value)
    • getListValuesByAttributeId

      public List<ListValue> getListValuesByAttributeId(UUID attributeId)
    • getByVisibilityAreaId

      public List<DataSetList> getByVisibilityAreaId(UUID visibilityAreaId)
    • getByDataSetListIdIn

      public List<DataSet> getByDataSetListIdIn(Collection<UUID> dataSetListIds)
    • getByIds

      public List<DataSet> getByIds(Collection<UUID> ids)
    • getParametersIdByDsId

      public List<UUID> getParametersIdByDsId(UUID dsId)
    • getLockedDatasets

      public List<DataSet> getLockedDatasets(UUID dataSetListId)
    • getNotUniqueDslNames

      public List<String> getNotUniqueDslNames(UUID visibilityArea)
    • getDsNamesForDsl

      public List<String> getDsNamesForDsl(UUID datasetListId)
    • getDatasetListIdByDatasetId

      public UUID getDatasetListIdByDatasetId(UUID dsId)
    • getDataSetsListIdByDataSetId

      public UUID getDataSetsListIdByDataSetId(UUID dsId)
    • getDataSetsIdsByDataSetListId

      public LinkedList<UUID> getDataSetsIdsByDataSetListId(UUID dataSetListId)
    • getAffectedDataSetsListIdsByDataSetListId

      public LinkedList<UUID> getAffectedDataSetsListIdsByDataSetListId(List<UUID> dataSetListId)
    • getAffectedDataSetsIdsByDataSetListId

      public Set<UUID> getAffectedDataSetsIdsByDataSetListId(Set<UUID> dataSetListId)
    • countAttributes

      public int countAttributes(UUID datasetId)
    • getNotUsedAttributesByDatasetId

      public List<Attribute> getNotUsedAttributesByDatasetId(UUID datasetId)
    • getAttributeTypeByAttributeId

      public AttributeTypeName getAttributeTypeByAttributeId(UUID attributeId)
    • getAttributesByDataSetId

      public List<Attribute> getAttributesByDataSetId(UUID dataSetId)
    • getAttributesKeyByDataSetId

      public List<AttributeKey> getAttributesKeyByDataSetId(UUID dataSetId)
    • isDsLocked

      public boolean isDsLocked(UUID dataSetId)
    • isDslDifferentAttributes

      public boolean isDslDifferentAttributes(UUID leftAttrId, UUID rightAttrId)
    • getUniqueDataSetIdsByReferenceDataSetId

      public Set<UUID> getUniqueDataSetIdsByReferenceDataSetId(UUID dataSetId)