/**
 * This class is generated by jOOQ
 */
package sample.jooq.domain.tables;

import java.util.Arrays;
import java.util.List;

import javax.annotation.Generated;

import org.jooq.Field;
import org.jooq.ForeignKey;
import org.jooq.Table;
import org.jooq.TableField;
import org.jooq.UniqueKey;
import org.jooq.impl.TableImpl;
import sample.jooq.domain.Keys;
import sample.jooq.domain.Public;
import sample.jooq.domain.tables.records.BookRecord;

/**
 * This class is generated by jOOQ.
 */
@Generated(value = { "http://www.jooq.org",
		"jOOQ version:3.6.2" }, comments = "This class is generated by jOOQ")
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Book extends TableImpl<BookRecord> {

	private static final long serialVersionUID = 1858247563;

	/**
	 * The reference instance of <code>PUBLIC.BOOK</code>
	 */
	public static final Book BOOK = new Book();

	/**
	 * The class holding records for this type
	 */
	@Override
	public Class<BookRecord> getRecordType() {
		return BookRecord.class;
	}

	/**
	 * The column <code>PUBLIC.BOOK.ID</code>.
	 */
	public final TableField<BookRecord, Integer> ID = createField("ID",
			org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");

	/**
	 * The column <code>PUBLIC.BOOK.AUTHOR_ID</code>.
	 */
	public final TableField<BookRecord, Integer> AUTHOR_ID = createField("AUTHOR_ID",
			org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");

	/**
	 * The column <code>PUBLIC.BOOK.TITLE</code>.
	 */
	public final TableField<BookRecord, String> TITLE = createField("TITLE",
			org.jooq.impl.SQLDataType.VARCHAR.length(400).nullable(false), this, "");

	/**
	 * The column <code>PUBLIC.BOOK.PUBLISHED_IN</code>.
	 */
	public final TableField<BookRecord, Integer> PUBLISHED_IN = createField(
			"PUBLISHED_IN", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");

	/**
	 * The column <code>PUBLIC.BOOK.LANGUAGE_ID</code>.
	 */
	public final TableField<BookRecord, Integer> LANGUAGE_ID = createField("LANGUAGE_ID",
			org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");

	/**
	 * Create a <code>PUBLIC.BOOK</code> table reference
	 */
	public Book() {
		this("BOOK", null);
	}

	/**
	 * Create an aliased <code>PUBLIC.BOOK</code> table reference
	 */
	public Book(String alias) {
		this(alias, BOOK);
	}

	private Book(String alias, Table<BookRecord> aliased) {
		this(alias, aliased, null);
	}

	private Book(String alias, Table<BookRecord> aliased, Field<?>[] parameters) {
		super(alias, Public.PUBLIC, aliased, parameters, "");
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public UniqueKey<BookRecord> getPrimaryKey() {
		return Keys.CONSTRAINT_1;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public List<UniqueKey<BookRecord>> getKeys() {
		return Arrays.<UniqueKey<BookRecord>>asList(Keys.CONSTRAINT_1);
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public List<ForeignKey<BookRecord, ?>> getReferences() {
		return Arrays.<ForeignKey<BookRecord, ?>>asList(Keys.FK_BOOK_AUTHOR,
				Keys.FK_BOOK_LANGUAGE);
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public Book as(String alias) {
		return new Book(alias, this);
	}

	/**
	 * Rename this table
	 */
	public Book rename(String name) {
		return new Book(name, null);
	}
}
