All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.eikecochu.sqlbuilder.BeforeSelect Maven / Gradle / Ivy

The newest version!
package com.github.eikecochu.sqlbuilder;

/**
 * Implemented by keywords that precede the SELECT statement.
 *
 * @param  the generic type returned by some fluent methods of this interface
 */
public interface BeforeSelect> extends QueryPart, QueryPartSQL, QueryPartLinked {

	/**
	 * Continue query with SELECT
	 *
	 * @return The new SELECT statement
	 */
	default Select select() {
		return new Select(this);
	}

	/**
	 * Continue query with SELECT
	 *
	 * @param columns The column names to select
	 * @return The new SELECT statement
	 */
	default Select select(final String... columns) {
		return select().columns(columns);
	}

	/**
	 * Accept an existing SELECT statement as predecessor
	 *
	 * @param select The existing SELECT statement
	 * @return Returns the passed SELECT statement
	 */
	default Select select(final Select select) {
		return select.parent(this);
	}

	/**
	 * Use plain SQL to form this SELECT statement
	 *
	 * @param sql The sql string
	 * @return The new SELECT statement
	 */
	default Select selectSQL(final String sql) {
		return select().sql(sql);
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy