/*
 * This file is generated by jOOQ.
 */
package com.databasir.dao.tables.records;


import com.databasir.dao.tables.UserRole;
import com.databasir.dao.tables.pojos.UserRolePojo;

import java.time.LocalDateTime;

import org.jooq.Field;
import org.jooq.Record1;
import org.jooq.Record5;
import org.jooq.Row5;
import org.jooq.impl.UpdatableRecordImpl;


/**
 * This class is generated by jOOQ.
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class UserRoleRecord extends UpdatableRecordImpl<UserRoleRecord> implements Record5<Integer, Integer, String, Integer, LocalDateTime> {

    private static final long serialVersionUID = 1L;

    /**
     * Setter for <code>databasir.user_role.id</code>.
     */
    public void setId(Integer value) {
        set(0, value);
    }

    /**
     * Getter for <code>databasir.user_role.id</code>.
     */
    public Integer getId() {
        return (Integer) get(0);
    }

    /**
     * Setter for <code>databasir.user_role.user_id</code>.
     */
    public void setUserId(Integer value) {
        set(1, value);
    }

    /**
     * Getter for <code>databasir.user_role.user_id</code>.
     */
    public Integer getUserId() {
        return (Integer) get(1);
    }

    /**
     * Setter for <code>databasir.user_role.role</code>. SYS_OWNER, GROUP_OWNER,
     * GROUP_MEMBER
     */
    public void setRole(String value) {
        set(2, value);
    }

    /**
     * Getter for <code>databasir.user_role.role</code>. SYS_OWNER, GROUP_OWNER,
     * GROUP_MEMBER
     */
    public String getRole() {
        return (String) get(2);
    }

    /**
     * Setter for <code>databasir.user_role.group_id</code>.
     */
    public void setGroupId(Integer value) {
        set(3, value);
    }

    /**
     * Getter for <code>databasir.user_role.group_id</code>.
     */
    public Integer getGroupId() {
        return (Integer) get(3);
    }

    /**
     * Setter for <code>databasir.user_role.create_at</code>.
     */
    public void setCreateAt(LocalDateTime value) {
        set(4, value);
    }

    /**
     * Getter for <code>databasir.user_role.create_at</code>.
     */
    public LocalDateTime getCreateAt() {
        return (LocalDateTime) get(4);
    }

    // -------------------------------------------------------------------------
    // Primary key information
    // -------------------------------------------------------------------------

    @Override
    public Record1<Integer> key() {
        return (Record1) super.key();
    }

    // -------------------------------------------------------------------------
    // Record5 type implementation
    // -------------------------------------------------------------------------

    @Override
    public Row5<Integer, Integer, String, Integer, LocalDateTime> fieldsRow() {
        return (Row5) super.fieldsRow();
    }

    @Override
    public Row5<Integer, Integer, String, Integer, LocalDateTime> valuesRow() {
        return (Row5) super.valuesRow();
    }

    @Override
    public Field<Integer> field1() {
        return UserRole.USER_ROLE.ID;
    }

    @Override
    public Field<Integer> field2() {
        return UserRole.USER_ROLE.USER_ID;
    }

    @Override
    public Field<String> field3() {
        return UserRole.USER_ROLE.ROLE;
    }

    @Override
    public Field<Integer> field4() {
        return UserRole.USER_ROLE.GROUP_ID;
    }

    @Override
    public Field<LocalDateTime> field5() {
        return UserRole.USER_ROLE.CREATE_AT;
    }

    @Override
    public Integer component1() {
        return getId();
    }

    @Override
    public Integer component2() {
        return getUserId();
    }

    @Override
    public String component3() {
        return getRole();
    }

    @Override
    public Integer component4() {
        return getGroupId();
    }

    @Override
    public LocalDateTime component5() {
        return getCreateAt();
    }

    @Override
    public Integer value1() {
        return getId();
    }

    @Override
    public Integer value2() {
        return getUserId();
    }

    @Override
    public String value3() {
        return getRole();
    }

    @Override
    public Integer value4() {
        return getGroupId();
    }

    @Override
    public LocalDateTime value5() {
        return getCreateAt();
    }

    @Override
    public UserRoleRecord value1(Integer value) {
        setId(value);
        return this;
    }

    @Override
    public UserRoleRecord value2(Integer value) {
        setUserId(value);
        return this;
    }

    @Override
    public UserRoleRecord value3(String value) {
        setRole(value);
        return this;
    }

    @Override
    public UserRoleRecord value4(Integer value) {
        setGroupId(value);
        return this;
    }

    @Override
    public UserRoleRecord value5(LocalDateTime value) {
        setCreateAt(value);
        return this;
    }

    @Override
    public UserRoleRecord values(Integer value1, Integer value2, String value3, Integer value4, LocalDateTime value5) {
        value1(value1);
        value2(value2);
        value3(value3);
        value4(value4);
        value5(value5);
        return this;
    }

    // -------------------------------------------------------------------------
    // Constructors
    // -------------------------------------------------------------------------

    /**
     * Create a detached UserRoleRecord
     */
    public UserRoleRecord() {
        super(UserRole.USER_ROLE);
    }

    /**
     * Create a detached, initialised UserRoleRecord
     */
    public UserRoleRecord(Integer id, Integer userId, String role, Integer groupId, LocalDateTime createAt) {
        super(UserRole.USER_ROLE);

        setId(id);
        setUserId(userId);
        setRole(role);
        setGroupId(groupId);
        setCreateAt(createAt);
    }

    /**
     * Create a detached, initialised UserRoleRecord
     */
    public UserRoleRecord(UserRolePojo value) {
        super(UserRole.USER_ROLE);

        if (value != null) {
            setId(value.getId());
            setUserId(value.getUserId());
            setRole(value.getRole());
            setGroupId(value.getGroupId());
            setCreateAt(value.getCreateAt());
        }
    }
}
