//
// Code generated by go-jet DO NOT EDIT.
//
// WARNING: Changes to this file may cause incorrect behavior
// and will be lost if the code is regenerated
//

package table

import (
	"github.com/Gleipnir-Technology/jet/postgres"
)

var AddressMapping = newAddressMappingTable("arcgis", "address_mapping", "")

type addressMappingTable struct {
	postgres.Table

	// Columns
	Destination               postgres.ColumnString
	LayerFeatureServiceItemID postgres.ColumnString
	LayerIndex                postgres.ColumnInteger
	LayerFieldName            postgres.ColumnString
	OrganizationID            postgres.ColumnInteger

	AllColumns     postgres.ColumnList
	MutableColumns postgres.ColumnList
	DefaultColumns postgres.ColumnList
}

type AddressMappingTable struct {
	addressMappingTable

	EXCLUDED addressMappingTable
}

// AS creates new AddressMappingTable with assigned alias
func (a AddressMappingTable) AS(alias string) *AddressMappingTable {
	return newAddressMappingTable(a.SchemaName(), a.TableName(), alias)
}

// Schema creates new AddressMappingTable with assigned schema name
func (a AddressMappingTable) FromSchema(schemaName string) *AddressMappingTable {
	return newAddressMappingTable(schemaName, a.TableName(), a.Alias())
}

// WithPrefix creates new AddressMappingTable with assigned table prefix
func (a AddressMappingTable) WithPrefix(prefix string) *AddressMappingTable {
	return newAddressMappingTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
}

// WithSuffix creates new AddressMappingTable with assigned table suffix
func (a AddressMappingTable) WithSuffix(suffix string) *AddressMappingTable {
	return newAddressMappingTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
}

func newAddressMappingTable(schemaName, tableName, alias string) *AddressMappingTable {
	return &AddressMappingTable{
		addressMappingTable: newAddressMappingTableImpl(schemaName, tableName, alias),
		EXCLUDED:            newAddressMappingTableImpl("", "excluded", ""),
	}
}

func newAddressMappingTableImpl(schemaName, tableName, alias string) addressMappingTable {
	var (
		DestinationColumn               = postgres.StringColumn("destination")
		LayerFeatureServiceItemIDColumn = postgres.StringColumn("layer_feature_service_item_id")
		LayerIndexColumn                = postgres.IntegerColumn("layer_index")
		LayerFieldNameColumn            = postgres.StringColumn("layer_field_name")
		OrganizationIDColumn            = postgres.IntegerColumn("organization_id")
		allColumns                      = postgres.ColumnList{DestinationColumn, LayerFeatureServiceItemIDColumn, LayerIndexColumn, LayerFieldNameColumn, OrganizationIDColumn}
		mutableColumns                  = postgres.ColumnList{LayerFeatureServiceItemIDColumn, LayerIndexColumn, LayerFieldNameColumn}
		defaultColumns                  = postgres.ColumnList{}
	)

	return addressMappingTable{
		Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),

		//Columns
		Destination:               DestinationColumn,
		LayerFeatureServiceItemID: LayerFeatureServiceItemIDColumn,
		LayerIndex:                LayerIndexColumn,
		LayerFieldName:            LayerFieldNameColumn,
		OrganizationID:            OrganizationIDColumn,

		AllColumns:     allColumns,
		MutableColumns: mutableColumns,
		DefaultColumns: defaultColumns,
	}
}
