Class AttributeRepository

java.lang.Object
org.qubership.atp.dataset.db.AbstractRepository
org.qubership.atp.dataset.db.AttributeRepository

@Repository public class AttributeRepository extends AbstractRepository
  • Field Details

    • queryFactory

      protected final com.querydsl.sql.SQLQueryFactory queryFactory
  • Constructor Details

  • Method Details

    • create

      @Nonnull public Attribute create(@Nonnull UUID dslId, @Nonnull Integer order, @Nonnull String name, @Nonnull AttributeType type, @Nullable UUID dslRefId, @Nullable List<String> listValues)
      Creates attribute.
      Parameters:
      dslRefId - if type == AttributeType.DSL
    • updateTypeDslId

      public boolean updateTypeDslId(@Nonnull UUID dslId, UUID id)
    • update

      public boolean update(@Nonnull UUID id, @Nonnull String name)
    • update

      protected long update(@Nonnull com.querydsl.core.types.Predicate predicate, @Nonnull String name)
    • updateDslRef

      public boolean updateDslRef(@Nonnull UUID id, @Nonnull UUID dataSetListId)
    • getById

      @Nullable public Attribute getById(@Nonnull UUID id)
    • existsById

      public boolean existsById(@Nonnull UUID id)
    • getByParentId

      @Nonnull public List<Attribute> getByParentId(@Nonnull UUID dslId)
    • getByParentId

      @Nonnull public List<Attribute> getByParentId(@Nonnull UUID dslId, @Nonnull AttributeType type)
    • getEagerByParentId

      @Nonnull public Collection<Attribute> getEagerByParentId(@Nonnull UUID dslId)
      Sorted collection of attributes that matches DataSetList id.
      Parameters:
      dslId - - DataSetList id.
      Returns:
      sorted collection of Attribute.
    • getAll

      @Nonnull public List<Attribute> getAll()
    • select

      @Nonnull protected com.querydsl.sql.SQLQuery<Attribute> select(@Nonnull com.querydsl.core.types.Predicate predicate)
    • delete

      public boolean delete(@Nonnull UUID id)
      Cascade delete attributes. Also removes list value, and parameters which bound to this attribute.
      Parameters:
      id - - attribute id.
      Returns:
      true attribute removed and false if not deleted.
    • updateOrdering

      public void updateOrdering(List<Pair<UUID,Integer>> attributesOrdering)
      Update ordering of attributes.
      Parameters:
      attributesOrdering - info about attributes for updating ({ID, ordering})