(String hostname)
| 122 | } |
| 123 | |
| 124 | public Server queryByHostName(String hostname) throws Exception { |
| 125 | List<Server> ret = cache.query("queryByHostName", hostname); |
| 126 | if (ret != null) { |
| 127 | |
| 128 | return ret.get(0); |
| 129 | } |
| 130 | |
| 131 | Server server = dao.queryBuilder().where().eq("ip", hostname).queryForFirst(); |
| 132 | |
| 133 | cache.set("queryByHostName", hostname, server); |
| 134 | return server; |
| 135 | } |
| 136 | |
| 137 | public Server query(int id) throws Exception { |
| 138 | List<Server> ret = cache.query("query", id); |
no test coverage detected