-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #123 from kbss-cvut/optimize-loading-time-of-fault…
…-tree-with-details Optimize loading time of fault tree with details
- Loading branch information
Showing
3 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,36 @@ | ||
package cz.cvut.kbss.analysis.dao; | ||
|
||
import cz.cvut.kbss.analysis.config.conf.PersistenceConf; | ||
import cz.cvut.kbss.analysis.model.Component; | ||
import cz.cvut.kbss.analysis.model.System; | ||
import cz.cvut.kbss.analysis.service.IdentifierService; | ||
import cz.cvut.kbss.analysis.service.security.SecurityUtils; | ||
import cz.cvut.kbss.analysis.util.Vocabulary; | ||
import cz.cvut.kbss.jopa.model.EntityManager; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.stereotype.Repository; | ||
|
||
import java.net.URI; | ||
import java.util.List; | ||
|
||
@Repository | ||
public class SystemDao extends ManagedEntityDao<System> { | ||
|
||
protected static final URI HAS_COMPONENT_PART = URI.create(Vocabulary.s_p_has_part_component); | ||
|
||
@Autowired | ||
protected SystemDao(EntityManager em, PersistenceConf config, IdentifierService identifierService, SecurityUtils securityUtils) { | ||
super(System.class, em, config, identifierService, securityUtils); | ||
} | ||
|
||
public List<Component> findComponents(URI systemURI){ | ||
return em.createNativeQuery(""" | ||
SELECT ?uri { | ||
?systemURI (?hasComponentPartProp)+ ?uri. | ||
} | ||
""") | ||
.setParameter("systemURI", systemURI) | ||
.setParameter("hasComponentPartProp", HAS_COMPONENT_PART) | ||
.getResultList(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters