|
static boolean | isEmpty (Dao dao, String table) |
|
static boolean | isEmpty (Dao dao, String table, String condition) |
|
static boolean | isEmpty (Dao dao, String table, String condition, Object... pars) |
|
static Long | count (Dao dao, String table) |
|
static Long | count (Dao dao, String table, String condition) |
|
static Long | count (Dao dao, String table, String condition, Object... pars) |
|
static Long | count (Dao dao, WhereClause wc) |
|
static String | getInClauseFromPaths (Collection< String > paths, boolean quoted) |
|
static String | getCommaSeparatedValues (Collection< String > values, boolean quoted) |
|
static String | getIdentifierFromPath (String e) |
|
static String | getJson (Dao dao, Class javaClass, Object identifier, final JSONSerializer json) |
|
- Author
- Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g
Definition at line 33 of file DaoUtil.java.
◆ count() [1/4]
static Long org.turro.jpa.DaoUtil.count |
( |
Dao |
dao, |
|
|
String |
table |
|
) |
| |
|
static |
Definition at line 50 of file DaoUtil.java.
51 Long
count = (Long) dao.getSingleResultOrNull(
"select count(x) from " + table +
" x");
static Long count(Dao dao, String table)
◆ count() [2/4]
static Long org.turro.jpa.DaoUtil.count |
( |
Dao |
dao, |
|
|
String |
table, |
|
|
String |
condition |
|
) |
| |
|
static |
Definition at line 55 of file DaoUtil.java.
56 Long
count = (Long) dao.getSingleResultOrNull(
"select count(x) from " + table +
" x " + condition);
◆ count() [3/4]
static Long org.turro.jpa.DaoUtil.count |
( |
Dao |
dao, |
|
|
String |
table, |
|
|
String |
condition, |
|
|
Object... |
pars |
|
) |
| |
|
static |
Definition at line 60 of file DaoUtil.java.
61 Long
count = (Long) dao.getSingleResultOrNull(
"select count(x) from " + table +
" x " + condition, pars);
◆ count() [4/4]
Definition at line 65 of file DaoUtil.java.
66 Long
count = (Long) dao.getSingleResultOrNull(wc);
◆ getCommaSeparatedValues()
static String org.turro.jpa.DaoUtil.getCommaSeparatedValues |
( |
Collection< String > |
values, |
|
|
boolean |
quoted |
|
) |
| |
|
static |
Definition at line 79 of file DaoUtil.java.
81 for(String s : values) {
82 if(quoted) s =
"\"" + s +
"\"";
83 result += (String) (Strings.isBlank(result) ? s :
"," + s);
◆ getIdentifierFromPath()
static String org.turro.jpa.DaoUtil.getIdentifierFromPath |
( |
String |
e | ) |
|
|
static |
Definition at line 88 of file DaoUtil.java.
89 return new Path(e).getNode(1);
◆ getInClauseFromPaths()
static String org.turro.jpa.DaoUtil.getInClauseFromPaths |
( |
Collection< String > |
paths, |
|
|
boolean |
quoted |
|
) |
| |
|
static |
Definition at line 70 of file DaoUtil.java.
73 public String getFrom(String e) {
static String getCommaSeparatedValues(Collection< String > values, boolean quoted)
static String getIdentifierFromPath(String e)
◆ getJson()
static String org.turro.jpa.DaoUtil.getJson |
( |
Dao |
dao, |
|
|
Class |
javaClass, |
|
|
Object |
identifier, |
|
|
final JSONSerializer |
json |
|
) |
| |
|
static |
Definition at line 92 of file DaoUtil.java.
93 final StringBuilder sb =
new StringBuilder();
94 dao.find(javaClass, identifier,
new DaoCallback() {
96 public void before(Object value) {
99 public void after(Object oldValue, Object newValue) {
100 json.setObject(newValue);
101 sb.append(json.toJson());
104 return sb.length() > 0 ? sb.toString() :
null;
◆ isEmpty() [1/3]
static boolean org.turro.jpa.DaoUtil.isEmpty |
( |
Dao |
dao, |
|
|
String |
table |
|
) |
| |
|
static |
◆ isEmpty() [2/3]
static boolean org.turro.jpa.DaoUtil.isEmpty |
( |
Dao |
dao, |
|
|
String |
table, |
|
|
String |
condition |
|
) |
| |
|
static |
◆ isEmpty() [3/3]
static boolean org.turro.jpa.DaoUtil.isEmpty |
( |
Dao |
dao, |
|
|
String |
table, |
|
|
String |
condition, |
|
|
Object... |
pars |
|
) |
| |
|
static |
The documentation for this class was generated from the following file: