@Test public void exists() { TestModel m = new TestModel(); m.title = "hej"; assertFalse(m.exists()); m.save(); assertTrue(m.exists()); }
final public boolean exists() { final Model m = Query.one( getClass(), String.format("SELECT * FROM %s WHERE %s LIMIT 1", Utils.getTableName(getClass()), Utils.getWhereStatement(this))).get(); return m != null; }
Model implements QueryResult { final public boolean exists() { final Model m = Query.one( getClass(), String.format("SELECT * FROM %s WHERE %s LIMIT 1", Utils.getTableName(getClass()), Utils.getWhereStatement(this))).get(); return m != null; } }
Model implements QueryResult { final public boolean exists() { final Model m = Query.one( getClass(), String.format("SELECT * FROM %s WHERE %s LIMIT 1", Utils.getTableName(getClass()), Utils.getWhereStatement(this))).get(); return m != null; }  }
Model implements QueryResult { final public boolean exists() { final Model m = Query.one( getClass(), String.format("SELECT * FROM %s WHERE %s LIMIT 1", Utils.getTableName(getClass()), Utils.getWhereStatement(this))).get(); return m != null; }  boolean isValid(); final boolean exists(); final boolean save(); final boolean save(Transaction t); final void saveAsync(); final void saveAsync(final OnSavedCallback callback); final void delete(); final void delete(Transaction t); final void deleteAsync(); final void deleteAsync(final OnDeletedCallback callback); }
Model implements QueryResult { final public boolean exists() { final Model m = Query.one( getClass(), String.format("SELECT * FROM %s WHERE %s LIMIT 1", Utils.getTableName(getClass()), Utils.getWhereStatement(this))).get(); return m != null; }  boolean isValid(); final boolean exists(); final boolean save(); final boolean save(Transaction t); final void saveAsync(); final void saveAsync(final OnSavedCallback callback); final void delete(); final void delete(Transaction t); final void deleteAsync(); final void deleteAsync(final OnDeletedCallback callback);  }