/** * Returns the first record. * * @throws EmptyRecordsException if no records exists. */ @Instrument public static <T extends Model> T first() { return (T)query().orderByIdAsc().first(); }
@Instrument public static <T extends Model> T firstOrNull() { return (T)query().orderByIdAsc().firstOrNull(); }
@Instrument public static <T extends Model> List<T> first(int num) { Args.assertTrue(num > 0,"num must be > 0"); return (List<T>)query().orderByIdAsc().limit(num).list(); }