|
static List< Skill > | getRootSkillsFrom (String rootFilter, SkillType... types) |
|
static List< SkillRoot > | getSkillsAsRootFrom (String entityPath, SkillType... types) |
|
static List< Skill > | getSkillsFrom (String entityPath, SkillType... types) |
|
static List< SkillRoot > | getAvailables (String rootFilter, SkillType... types) |
|
static List< SkillRoot > | getValidateds (String rootFilter, SkillType... types) |
|
static List< SkillRoot > | getAvailables (String rootFilter, boolean validated, SkillType... types) |
|
static void | addSkillFor (String entityPath, Skill skill) |
|
static void | setSkillsFor (String entityPath, Set< Skill > skills, SkillType... types) |
|
static void | removeSkillsFor (String entityPath, SkillType... types) |
|
static void | removeSkillsFor (Dao dao, String entityPath, SkillType... types) |
|
static void | removeSkills (String entityPath) |
|
static Set< String > | getAllPaths (String root) |
|
- Author
- Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g
Definition at line 38 of file Skills.java.
◆ addSkillFor()
static void org.turro.skills.Skills.addSkillFor |
( |
String |
entityPath, |
|
|
Skill |
skill |
|
) |
| |
|
static |
Definition at line 85 of file Skills.java.
86 Dao dao =
new ElephantPU();
87 skill.setEntityPath(entityPath);
88 dao.saveObject(skill);
◆ getAllPaths()
static Set<String> org.turro.skills.Skills.getAllPaths |
( |
String |
root | ) |
|
|
static |
Definition at line 125 of file Skills.java.
126 return new HashSet<>(SqlClause.select(
"distinct s.entityPath").from(
"Skill s")
127 .where().startsWith(
"s.entityPath",
"/" + root +
"/")
128 .dao(
new ElephantPU())
129 .resultList(String.class));
◆ getAvailables() [1/2]
static List<SkillRoot> org.turro.skills.Skills.getAvailables |
( |
String |
rootFilter, |
|
|
boolean |
validated, |
|
|
SkillType... |
types |
|
) |
| |
|
static |
Definition at line 68 of file Skills.java.
69 WhereClause wc =
new WhereClause();
70 wc.addClause(
"select new org.turro.skills.SkillRoot(s.skill, s.type, count(s))");
71 wc.addClause(
"from Skill s");
72 wc.addClause(validated ?
"where s.validated = TRUE" :
"where 1=1");
73 if(!Strings.isBlank(rootFilter)) {
74 wc.addClause(
"and s.entityPath like :root");
75 wc.addNamedValue(
"root",
"/" + rootFilter +
"/%");
78 wc.addClause(
"and s.type in (:types)");
79 wc.addNamedValue(
"types", Arrays.asList(types));
81 wc.addClause(
"group by s.skill, s.type");
82 return new ElephantPU().getResultList(SkillRoot.class, wc);
◆ getAvailables() [2/2]
static List<SkillRoot> org.turro.skills.Skills.getAvailables |
( |
String |
rootFilter, |
|
|
SkillType... |
types |
|
) |
| |
|
static |
Definition at line 60 of file Skills.java.
static List< SkillRoot > getAvailables(String rootFilter, SkillType... types)
◆ getRootSkillsFrom()
static List<Skill> org.turro.skills.Skills.getRootSkillsFrom |
( |
String |
rootFilter, |
|
|
SkillType... |
types |
|
) |
| |
|
static |
Definition at line 40 of file Skills.java.
41 return getSkillsFrom(rootFilter ==
null ?
"*" : rootFilter, types);
static List< Skill > getSkillsFrom(String entityPath, SkillType... types)
◆ getSkillsAsRootFrom()
static List<SkillRoot> org.turro.skills.Skills.getSkillsAsRootFrom |
( |
String |
entityPath, |
|
|
SkillType... |
types |
|
) |
| |
|
static |
Definition at line 44 of file Skills.java.
45 return getSkillsFrom(entityPath, types).stream().map(s ->
new SkillRoot(s)).collect(Collectors.toList());
◆ getSkillsFrom()
static List<Skill> org.turro.skills.Skills.getSkillsFrom |
( |
String |
entityPath, |
|
|
SkillType... |
types |
|
) |
| |
|
static |
Definition at line 48 of file Skills.java.
49 WhereClause wc =
new WhereClause();
50 wc.addClause(
"select s from Skill s");
51 wc.addClause(
"where s.entityPath = :path");
52 wc.addNamedValue(
"path", entityPath);
54 wc.addClause(
"and s.type in (:types)");
55 wc.addNamedValue(
"types", Arrays.asList(types));
57 return new ElephantPU().getResultList(Skill.class, wc);
◆ getValidateds()
static List<SkillRoot> org.turro.skills.Skills.getValidateds |
( |
String |
rootFilter, |
|
|
SkillType... |
types |
|
) |
| |
|
static |
◆ removeSkills()
static void org.turro.skills.Skills.removeSkills |
( |
String |
entityPath | ) |
|
|
static |
Definition at line 114 of file Skills.java.
115 Dao dao =
new ElephantPU();
116 WhereClause wc =
new WhereClause();
117 wc.addClause(
"delete from Skill");
118 wc.addClause(
"where entityPath = :path");
119 wc.addNamedValue(
"path", entityPath);
120 dao.executeUpdate(wc);
◆ removeSkillsFor() [1/2]
static void org.turro.skills.Skills.removeSkillsFor |
( |
Dao |
dao, |
|
|
String |
entityPath, |
|
|
SkillType... |
types |
|
) |
| |
|
static |
Definition at line 102 of file Skills.java.
103 WhereClause wc =
new WhereClause();
104 wc.addClause(
"delete from Skill s");
105 wc.addClause(
"where s.entityPath = :path");
106 wc.addNamedValue(
"path", entityPath);
108 wc.addClause(
"and s.type in (:types)");
109 wc.addNamedValue(
"types", Arrays.asList(types));
111 dao.executeUpdate(wc);
◆ removeSkillsFor() [2/2]
static void org.turro.skills.Skills.removeSkillsFor |
( |
String |
entityPath, |
|
|
SkillType... |
types |
|
) |
| |
|
static |
Definition at line 98 of file Skills.java.
static void removeSkillsFor(String entityPath, SkillType... types)
◆ setSkillsFor()
static void org.turro.skills.Skills.setSkillsFor |
( |
String |
entityPath, |
|
|
Set< Skill > |
skills, |
|
|
SkillType... |
types |
|
) |
| |
|
static |
Definition at line 91 of file Skills.java.
92 Dao dao =
new ElephantPU();
94 skills.forEach(s -> s.setEntityPath(entityPath));
95 dao.saveCollection(skills);
The documentation for this class was generated from the following file: