/** * Join another model through a referenced model * * @param reference The reference to another model in the referenced model * @param <U> The type of the another model being joined * @return A {@link net.symplifier.db.Query.Join} object for chaining */ default <U extends Model> Query.Join<T> join(Reference<? super T, U> reference) { Query.Join<T> j = new Query.Join<>(this); return j.join(reference); }
/** * Join another model with filters through a referenced model. A helper mechanism to join after a * filter has been applied on the source reference during initial join * * @param join The join object that had been returned by {@link Reference#where(Query.Filter)} * during parent level join * @param <U> The type of the another model being joined * @return A {@link net.symplifier.db.Query.Join} object for chaining */ default <U extends Model> Query.Join<T> join(Query.Join<U> join) { Query.Join<T> j = new Query.Join<>(this); return j.join(join); }
/** * Provide descending order by columns for ordering the result set * * @param columns List of column that are used for ordering * @return Returns a {@link net.symplifier.db.Query.Join} for chaining joins * @see {@link #asc(Column[])} */ default Query.Join<T> desc(Column<T, ?>... columns) { Query.Join<T> j = new Query.Join<>(this); j.desc(columns); return j; }