@Repository public interface SystemRepository extends StorableRepository<System>
| Modifier and Type | Method and Description |
|---|---|
System |
findByEcLabel(String ecLabel,
BigInteger projectId) |
Collection<System> |
findByPieceOfNameAndProject(String name,
BigInteger projectId) |
Collection<System> |
findByProject(BigInteger projectId) |
Operation |
findFirstByDefineOperation(BigInteger parentId,
String key) |
System |
findSystemByEcId(String ecId) |
Set<String> |
getAllLabels(BigInteger projectId) |
Collection<String> |
getEcProjectIds(BigInteger projectId) |
List<BigInteger> |
getReceiverSystemIdsFromCallChainSteps(BigInteger chainId) |
List<IdNamePair> |
getSimpleListByProject(BigInteger projectId) |
List<BigInteger> |
getSituationEventTriggersBySystemId(BigInteger systemId) |
Collection<System> |
getSystemsByEcProject(String ecProjectId) |
List<BigInteger> |
getTransportTriggersBySystemId(BigInteger systemId) |
void |
unbindByEcProject(String ecProjectId) |
findByParentID, findByParentIDAndName, findByParentNamefindByName, findByNameContainingIgnoreCase, findByNaturalIddeleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, findAll, findAll, findAllById, flush, getById, getOne, getReferenceById, saveAll, saveAllAndFlush, saveAndFlushfindAll@Query(value="select oper from Operation oper where parent_id = :parentId and definition_key = :key ")
@QueryHints(value={@QueryHint(name="org.hibernate.cacheable",value="true"),})
Operation findFirstByDefineOperation(@Param(value="parentId")
BigInteger parentId,
@Param(value="key")
String key)
@Query(value="select distinct s_labels.labels as labels from mb_systems as s inner join mb_systems_labels as s_labels on s_labels.id = s.id where project_id = :projectId union select distinct mfl.labels as labels from mb_folders as mf inner join mb_folders_labels as mfl on mfl.id =mf.id where mf.\"type\" = \'systems\' and mf.project_id = :projectId",
nativeQuery=true)
Set<String> getAllLabels(@Param(value="projectId")
BigInteger projectId)
@Query(value="select sys from System sys where sys.ecId = :ecId") System findSystemByEcId(@Param(value="ecId") String ecId)
@Query(value="select ec_project_id from mb_systems where ec_project_id is not null and project_id = :projectId group by ec_project_id",
nativeQuery=true)
Collection<String> getEcProjectIds(@Param(value="projectId")
BigInteger projectId)
@Query(value="select system from System system where system.ecProjectId = :ecProjectId") Collection<System> getSystemsByEcProject(@Param(value="ecProjectId") String ecProjectId)
@Modifying
@Query(value="update mb_systems set ec_project_id = null, ec_id = null, ec_label = null where ec_project_id = :ecProjectId",
nativeQuery=true)
void unbindByEcProject(@Param(value="ecProjectId")
String ecProjectId)
@Query(value="select sys from System sys where sys.ecLabel = :ecLabel and sys.projectId = :projectId and sys.ecId is not null") System findByEcLabel(@Param(value="ecLabel") String ecLabel, @Param(value="projectId") BigInteger projectId)
@Query(value="select system from System system where lower(system.name) like concat(\'%\', lower(:name), \'%\') and system.projectId = :projectId") Collection<System> findByPieceOfNameAndProject(@Param(value="name") String name, @Param(value="projectId") BigInteger projectId)
@Query(value="select system from System system where system.projectId = :projectId") Collection<System> findByProject(@Param(value="projectId") BigInteger projectId)
@Query(value="select distinct receiver_id FROM mb_steps WHERE parent_id in ( SELECT distinct situation_id FROM mb_steps WHERE parent_id in ( WITH RECURSIVE embedded_steps (chain_id) AS ( SELECT distinct chain_id FROM mb_steps WHERE parent_id = :chainId and enabled and \"type\"=\'embedded\' and chain_id is not null UNION SELECT distinct p.chain_id FROM mb_steps p INNER JOIN embedded_steps ON embedded_steps.chain_id = p.parent_id and p.enabled and p.\"type\"=\'embedded\' and p.chain_id is not null ) select * from embedded_steps union select :chainId ) and enabled and \"type\"=\'situation\' and situation_id is not null )",
nativeQuery=true)
List<BigInteger> getReceiverSystemIdsFromCallChainSteps(@Param(value="chainId")
BigInteger chainId)
@Query(value="select new org.qubership.automation.itf.core.model.IdNamePair(system.id, system.name) from System as system where system.projectId = :projectId")
@QueryHints(value={@QueryHint(name="org.hibernate.cacheable",value="true"),})
List<IdNamePair> getSimpleListByProject(@Param(value="projectId")
BigInteger projectId)
@Query(value="select id from mb_configuration where parent_conf_id in (select id from mb_configuration where transport_id in (select id from mb_configuration where parent_system_id = :systemId))",
nativeQuery=true)
List<BigInteger> getTransportTriggersBySystemId(@Param(value="systemId")
BigInteger systemId)
@Query(value="select id from mb_triggers where set_parent_id in (select id from mb_situation where parent_id in (select id from mb_operations where parent_id = :systemId))",
nativeQuery=true)
List<BigInteger> getSituationEventTriggersBySystemId(@Param(value="systemId")
BigInteger systemId)
Copyright © 2025. All rights reserved.