- Author
- Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g
Definition at line 41 of file GroupIt.java.
◆ categories()
static Collection<String> org.turro.contacts.GroupIt.categories |
( |
| ) |
|
|
static |
Definition at line 115 of file GroupIt.java.
116 Dao dao =
new ContactsPU();
117 return dao.getResultList(
118 " select distinct g.category from GroupIt g"
◆ children() [1/2]
Collection<GroupIt> org.turro.contacts.GroupIt.children |
( |
| ) |
|
Definition at line 148 of file GroupIt.java.
149 Dao dao =
new ContactsPU();
150 return dao.getResultList(
151 " select g from GroupIt g " +
152 " where g.category = ? " +
◆ children() [2/2]
Collection<GroupIt> org.turro.contacts.GroupIt.children |
( |
String |
entityPath | ) |
|
Definition at line 158 of file GroupIt.java.
159 Dao dao =
new ContactsPU();
160 return dao.getResultList(
161 " select g from GroupIt g " +
162 " where g.category = ? " +
163 " and g.parent = ? " +
165 " select gd from Grouped gd " +
166 " where (gd.parent.pathName like concat(g.pathName, '/%') " +
167 " or gd.parent.pathName = g.pathName) " +
168 " and gd.path like ? " +
170 new Object[] { this.
getCategory(),
this, entityPath +
"/%" }
◆ delete()
static void org.turro.contacts.GroupIt.delete |
( |
String |
path | ) |
|
|
static |
Definition at line 234 of file GroupIt.java.
235 Dao dao =
new ContactsPU();
237 "delete from Grouped where parent in (select gi from GroupIt gi where gi.pathName = ? or gi.pathName like ?)",
238 new Object[] { path, path +
"/%" });
240 "delete from GroupIt where pathName = ? or pathName like ?",
241 new Object[] { path, path +
"/%" });
◆ entities()
Collection<Grouped> org.turro.contacts.GroupIt.entities |
( |
| ) |
|
Definition at line 174 of file GroupIt.java.
175 Dao dao =
new ContactsPU();
176 return dao.getResultList(
177 " select g from Grouped g " +
178 " where g.parent.category = ? " +
◆ fields()
Definition at line 263 of file GroupIt.java.
264 FieldItSet fiu = FieldItUtil.fields(ContactsPU.getObjectPath(
this));
267 fiu.addAll(FieldItUtil.fields(ContactsPU.getObjectPath(gi)));
◆ fullEntities() [1/2]
Collection<Grouped> org.turro.contacts.GroupIt.fullEntities |
( |
| ) |
|
Definition at line 184 of file GroupIt.java.
185 Dao dao =
new ContactsPU();
186 return dao.getResultList(
187 " select g from Grouped g " +
188 " where g.parent.category = ? " +
189 " and (g.parent = ? or g.parent.path like ?)",
◆ fullEntities() [2/2]
Collection<Grouped> org.turro.contacts.GroupIt.fullEntities |
( |
String |
entityRoot | ) |
|
Definition at line 194 of file GroupIt.java.
195 Dao dao =
new ContactsPU();
196 return dao.getResultList(
197 " select g from Grouped g " +
198 " where g.parent.category = ? " +
199 " and (g.parent = ? or g.parent.path like ?) " +
200 " and g.path like ? ",
◆ getCategory()
String org.turro.contacts.GroupIt.getCategory |
( |
| ) |
|
◆ getId()
String org.turro.contacts.GroupIt.getId |
( |
| ) |
|
◆ getName()
String org.turro.contacts.GroupIt.getName |
( |
| ) |
|
◆ getOrCreate()
static GroupIt org.turro.contacts.GroupIt.getOrCreate |
( |
String |
category, |
|
|
String |
node, |
|
|
GroupIt |
parent |
|
) |
| |
|
static |
Definition at line 244 of file GroupIt.java.
245 Dao dao =
new ContactsPU();
246 String parentPath = parent !=
null ? parent.
getPathName() +
"/" :
"/";
247 GroupIt gi = (GroupIt) dao.getSingleResultOrNull(
248 "select g from GroupIt g where g.category = ? and g.pathName = ?",
249 new Object[] { category, parentPath + node });
252 gi.setCategory(category);
254 gi.setParent(parent);
255 gi.setPublishable(
true);
256 gi = gi.normalizePaths(gi);
◆ getParent()
GroupIt org.turro.contacts.GroupIt.getParent |
( |
| ) |
|
◆ getPathName()
String org.turro.contacts.GroupIt.getPathName |
( |
| ) |
|
◆ isPublishable()
boolean org.turro.contacts.GroupIt.isPublishable |
( |
| ) |
|
◆ isValid()
boolean org.turro.contacts.GroupIt.isValid |
( |
| ) |
|
Definition at line 110 of file GroupIt.java.
111 return !Strings.isBlank(name) &&
◆ normalizePaths() [1/2]
static GroupIt org.turro.contacts.GroupIt.normalizePaths |
( |
GroupIt |
group | ) |
|
|
static |
Definition at line 206 of file GroupIt.java.
207 Dao dao =
new ContactsPU();
208 String d =
"/" + group.getName();
209 GroupIt g = group.getParent();
211 d =
"/" + g.getName() + d;
214 group.setPathName(d);
215 return dao.saveObject(group);
◆ normalizePaths() [2/2]
static void org.turro.contacts.GroupIt.normalizePaths |
( |
String |
oldPath | ) |
|
|
static |
Definition at line 218 of file GroupIt.java.
219 Dao dao =
new ContactsPU();
220 for(GroupIt group : (List<GroupIt>) dao.getResultList(
221 "select g from GroupIt g where g.pathName like ?",
222 new Object[] { oldPath +
"/%" })) {
223 String d =
"/" + group.getName();
224 GroupIt g = group.getParent();
226 d =
"/" + g.getName() + d;
229 group.setPathName(d);
230 dao.saveObject(group);
◆ roots() [1/2]
static Collection<GroupIt> org.turro.contacts.GroupIt.roots |
( |
String |
category | ) |
|
|
static |
Definition at line 122 of file GroupIt.java.
123 Dao dao =
new ContactsPU();
124 return dao.getResultList(
125 " select g from GroupIt g " +
126 " where g.category = ? " +
127 " and g.parent is null",
128 new Object[] { category }
◆ roots() [2/2]
static Collection<GroupIt> org.turro.contacts.GroupIt.roots |
( |
String |
category, |
|
|
String |
entityPath |
|
) |
| |
|
static |
Definition at line 132 of file GroupIt.java.
133 Dao dao =
new ContactsPU();
134 return dao.getResultList(
135 " select g from GroupIt g " +
136 " where g.category = ? " +
137 " and g.parent is null " +
139 " select gd from Grouped gd " +
140 " where (gd.parent.pathName like concat(g.pathName, '/%') " +
141 " or gd.parent.pathName = g.pathName) " +
142 " and gd.path like ? " +
144 new Object[] { category, entityPath +
"/%" }
◆ setCategory()
void org.turro.contacts.GroupIt.setCategory |
( |
String |
category | ) |
|
Definition at line 72 of file GroupIt.java.
73 this.category = category;
◆ setId()
void org.turro.contacts.GroupIt.setId |
( |
String |
id | ) |
|
◆ setName()
void org.turro.contacts.GroupIt.setName |
( |
String |
name | ) |
|
◆ setParent()
void org.turro.contacts.GroupIt.setParent |
( |
GroupIt |
parent | ) |
|
◆ setPathName()
void org.turro.contacts.GroupIt.setPathName |
( |
String |
pathName | ) |
|
Definition at line 88 of file GroupIt.java.
89 this.pathName = pathName;
◆ setPublishable()
void org.turro.contacts.GroupIt.setPublishable |
( |
boolean |
publishable | ) |
|
Definition at line 104 of file GroupIt.java.
105 this.publishable = publishable;
The documentation for this class was generated from the following file: