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 ; }
Check whether this model exists in the database