/** * Load all. * * @return the list */ public static List<UrlMapping> loadAll() { if (cache == null) { cache = Bean.load(null, null, null, "order by seq", 0, Integer.MAX_VALUE, UrlMapping.class); } return cache; }
/** * Creates the. * * @param url the url * @param dest the dest * @param seq the seq * @return the int */ public static int create(String url, String dest, int seq) { cache = null; return Bean.insert(V.create("url", url).set("dest", dest), UrlMapping.class); }
/** * Update. * * @param url the url * @param dest the dest * @param seq the seq * @return the int */ public static int update(String url, String dest, int seq) { cache = null; return Bean.update( "url=?", new Object[] {url}, V.create("dest", dest).set("seq", seq), UrlMapping.class); }
/** * Delete. * * @param url the url */ public static void delete(String url) { Bean.delete("url=?", new Object[] {url}, UrlMapping.class); cache = null; }
/** * Load. * * @param url the url * @return the url mapping */ public static UrlMapping load(String url) { return Bean.load("tblurlmapping", "url=?", new Object[] {url}, UrlMapping.class); }
/** * Load. * * @param offset the offset * @param limit the limit * @return the beans */ public static Beans<UrlMapping> load(int offset, int limit) { return Bean.load(null, null, "order by url", offset, limit, UrlMapping.class); }
/** * Gets the dest. * * @param url the url * @return the dest */ public static String getDest(String url) { return Bean.getString("tblurlmapping", "dest", "url=?", new String[] {url}, null); }