- Author
- Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g
Definition at line 40 of file SkillTags.java.
◆ getAvailables() [1/2]
static SkillSet org.turro.skills.tags.SkillTags.getAvailables |
( |
String |
root | ) |
|
|
static |
Definition at line 42 of file SkillTags.java.
43 Dao dao =
new ElephantPU();
44 WhereClause wc =
new WhereClause();
45 wc.addClause(
"select new org.turro.skills.tags.SkillItem(t.skill, t.type, count(t))");
46 wc.addClause(
"from Skill t");
47 wc.addIn(
"where",
"t.type", Arrays.asList(SkillType.values()));
48 if(!Strings.isBlank(root)) {
49 wc.addClause(
"and t.entityPath like concat('/', :root, '/%')");
50 wc.addNamedValue(
"root", root);
52 wc.addClause(
"group by t.skill, t.type");
53 return new SkillSet(dao.getResultList(wc));
◆ getAvailables() [2/2]
static SkillSet org.turro.skills.tags.SkillTags.getAvailables |
( |
String |
root, |
|
|
boolean |
user |
|
) |
| |
|
static |
Definition at line 56 of file SkillTags.java.
57 Dao dao =
new ElephantPU();
58 WhereClause wc =
new WhereClause();
59 wc.addClause(
"select new org.turro.skills.tags.SkillItem(t.skill, t.type, count(t))");
60 wc.addClause(
"from Skill t");
61 wc.addIn(
"where",
"t.type",
new ArrayList(user ? SkillType.getNaturals() : SkillType.getJuridicals()));
62 if(!Strings.isBlank(root)) {
63 wc.addClause(
"and t.entityPath like concat('/', :root, '/%')");
64 wc.addNamedValue(
"root", root);
66 wc.addClause(
"group by t.skill, t.type");
67 return new SkillSet(dao.getResultList(wc));
◆ getEntityPaths() [1/2]
static List<String> org.turro.skills.tags.SkillTags.getEntityPaths |
( |
Dao |
dao, |
|
|
String |
root, |
|
|
Set< SkillItem > |
set |
|
) |
| |
|
static |
Definition at line 112 of file SkillTags.java.
113 List<String> skills =
set.stream().map(t -> t.getSkillName()).collect(Collectors.toList());
114 if(!skills.isEmpty()) {
115 WhereClause wc =
new WhereClause();
116 wc.addClause(
"select distinct t.entityPath from Skill t");
117 wc.addClause(
"where 1=1");
118 if(!Strings.isBlank(root)) {
119 wc.addClause(
"and t.entityPath like concat('/', :root, '/%')");
120 wc.addNamedValue(
"root", root);
123 for(String skill : skills) {
124 wc.addClause(
"and exists (");
125 wc.addClause(
"select t2.entityPath from Skill t2");
126 wc.addClause(
"where t2.entityPath = t.entityPath");
127 wc.addClause(
"and t2.skill = :skill" + count);
128 wc.addNamedValue(
"skill" + count, skill);
132 return dao.getResultList(String.class, wc);
134 return Collections.EMPTY_LIST;
◆ getEntityPaths() [2/2]
static List<String> org.turro.skills.tags.SkillTags.getEntityPaths |
( |
String |
root, |
|
|
Set< SkillItem > |
set |
|
) |
| |
|
static |
◆ getIdentifiers() [1/2]
static List<String> org.turro.skills.tags.SkillTags.getIdentifiers |
( |
Dao |
dao, |
|
|
String |
root, |
|
|
Set< SkillItem > |
set |
|
) |
| |
|
static |
Definition at line 104 of file SkillTags.java.
105 return getEntityPaths(dao, root,
set).stream().map(s -> Path.getIdentifier(s)).collect(Collectors.toList());
◆ getIdentifiers() [2/2]
static List<String> org.turro.skills.tags.SkillTags.getIdentifiers |
( |
String |
root, |
|
|
Set< SkillItem > |
set |
|
) |
| |
|
static |
◆ getSiblings()
static SkillSet org.turro.skills.tags.SkillTags.getSiblings |
( |
String |
root, |
|
|
Set< String > |
skillNames |
|
) |
| |
|
static |
Definition at line 70 of file SkillTags.java.
71 Dao dao =
new ElephantPU();
72 SkillSet finalSet =
null;
73 for(String tag : skillNames) {
75 if(finalSet !=
null) {
76 finalSet.retainAll(
set);
81 return Optional.ofNullable(finalSet).orElseGet(() -> SkillSet.empty());
◆ getSkills() [1/2]
static SkillSet org.turro.skills.tags.SkillTags.getSkills |
( |
Object |
entity | ) |
|
|
static |
◆ getSkills() [2/2]
static SkillSet org.turro.skills.tags.SkillTags.getSkills |
( |
String |
entityPath | ) |
|
|
static |
Definition at line 141 of file SkillTags.java.
142 Dao dao =
new ElephantPU();
143 WhereClause wc =
new WhereClause();
144 wc.addClause(
"select new org.turro.skils.tags.SkillItem(t.skill, t.type, count(t))");
145 wc.addClause(
"from Skill t");
146 wc.addClause(
"where t.entityPath = :path");
147 wc.addNamedValue(
"path", entityPath);
148 wc.addClause(
"group by t.skill, t.type");
149 return new SkillSet(dao.getResultList(wc));
The documentation for this class was generated from the following file: