◆ addWebUrl()
static EntityWebUrl org.turro.jpa.entity.EntityWebUrls.addWebUrl |
( |
String |
entityPath, |
|
|
String |
url |
|
) |
| |
|
static |
Definition at line 65 of file EntityWebUrls.java.
67 EntityWebUrl ewu =
new EntityWebUrl();
68 ewu.setEntityPath(entityPath);
69 ewu.setEntityUrl(url);
70 return new ElephantPU().saveObject(ewu);
static void removeEntityUrl(String entityPath)
◆ existsAnyOf()
static boolean org.turro.jpa.entity.EntityWebUrls.existsAnyOf |
( |
String |
entityPath | ) |
|
|
static |
Definition at line 91 of file EntityWebUrls.java.
92 Dao dao =
new ElephantPU();
93 WhereClause wc =
new WhereClause();
94 wc.addClause(
"select count(w) from EntityWebUrl w");
95 wc.addClause(
"where w.entityPath like :path");
96 wc.addNamedValue(
"path", entityPath +
"%");
97 return ((Long) dao.getSingleResultOrNull(wc)) > 0;
◆ existsEntity()
static boolean org.turro.jpa.entity.EntityWebUrls.existsEntity |
( |
String |
entityPath | ) |
|
|
static |
Definition at line 82 of file EntityWebUrls.java.
83 Dao dao =
new ElephantPU();
84 WhereClause wc =
new WhereClause();
85 wc.addClause(
"select w from EntityWebUrl w");
86 wc.addClause(
"where w.entityPath = :path");
87 wc.addNamedValue(
"path", entityPath);
88 return !dao.getResultList(wc).isEmpty();
◆ getEntity()
static Object org.turro.jpa.entity.EntityWebUrls.getEntity |
( |
String |
entityRoot, |
|
|
String |
url |
|
) |
| |
|
static |
Definition at line 34 of file EntityWebUrls.java.
35 return Entities.getController(
getEntityPath(entityRoot, url)).getEntity();
static String getEntityPath(String entityRoot, String url)
◆ getEntityPath()
static String org.turro.jpa.entity.EntityWebUrls.getEntityPath |
( |
String |
entityRoot, |
|
|
String |
url |
|
) |
| |
|
static |
Definition at line 38 of file EntityWebUrls.java.
39 if(url.contains(
"?")) {
40 url = url.substring(0, url.indexOf(
"?"));
42 Dao dao =
new ElephantPU();
43 WhereClause wc =
new WhereClause();
44 wc.addClause(
"select w.entityPath from EntityWebUrl w");
45 wc.addClause(
"where w.entityUrl = :url");
46 wc.addNamedValue(
"url", url);
47 wc.addClause(
"and w.entityPath like :path");
48 wc.addNamedValue(
"path", entityRoot +
"%");
49 return (String) dao.getSingleResultOrNull(wc);
◆ getUrl()
static String org.turro.jpa.entity.EntityWebUrls.getUrl |
( |
String |
entityPath | ) |
|
|
static |
Definition at line 56 of file EntityWebUrls.java.
57 Dao dao =
new ElephantPU();
58 WhereClause wc =
new WhereClause();
59 wc.addClause(
"select w.entityUrl from EntityWebUrl w");
60 wc.addClause(
"where w.entityPath = :path");
61 wc.addNamedValue(
"path", entityPath);
62 return (String) dao.getSingleResultOrNull(wc);
◆ getUrlFromEntity()
static String org.turro.jpa.entity.EntityWebUrls.getUrlFromEntity |
( |
Object |
entity | ) |
|
|
static |
Definition at line 52 of file EntityWebUrls.java.
53 return getUrl(Entities.getController(entity).getPath());
static String getUrl(String entityPath)
◆ removeEntityUrl()
static void org.turro.jpa.entity.EntityWebUrls.removeEntityUrl |
( |
String |
entityPath | ) |
|
|
static |
Definition at line 73 of file EntityWebUrls.java.
74 Dao dao =
new ElephantPU();
75 WhereClause wc =
new WhereClause();
76 wc.addClause(
"delete from EntityWebUrl");
77 wc.addClause(
"where entityPath = :path");
78 wc.addNamedValue(
"path", entityPath);
79 dao.executeUpdate(wc);
◆ sameURL()
static boolean org.turro.jpa.entity.EntityWebUrls.sameURL |
( |
String |
url1, |
|
|
String |
url2 |
|
) |
| |
|
static |
Definition at line 100 of file EntityWebUrls.java.
101 if(url1.endsWith(
"/")) url1 = url1.substring(0, url1.length() - 1);
102 if(url2.endsWith(
"/")) url2 = url2.substring(0, url2.length() - 1);
103 return CompareUtil.compare(url1, url2) == 0;
The documentation for this class was generated from the following file: