Beispiel #1
0
  /**
   * 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;
  }
Beispiel #2
0
 /**
  * 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);
 }
Beispiel #3
0
 /**
  * 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);
 }
Beispiel #4
0
 /**
  * Delete.
  *
  * @param url the url
  */
 public static void delete(String url) {
   Bean.delete("url=?", new Object[] {url}, UrlMapping.class);
   cache = null;
 }
Beispiel #5
0
 /**
  * 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);
 }
Beispiel #6
0
 /**
  * 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);
 }
Beispiel #7
0
 /**
  * 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);
 }