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

com.dbobjekts.metadata.joins.JoinBase.kt Maven / Gradle / Ivy

There is a newer version: 0.6.0-RC2
Show newest version
package com.dbobjekts.metadata.joins

import com.dbobjekts.api.AnyColumn
import com.dbobjekts.api.AnyTable
import com.dbobjekts.metadata.Table

abstract class JoinBase(val leftPart: AnyColumn,
                        val rightPart: AnyColumn) {

  abstract val keyWord: String

  val conditionSQL: String = "${rightPart.table.toSQL()} on ${leftPart.aliasDotName()} = ${rightPart.aliasDotName()}"

  override fun toString(): String = "${leftPart.table.toSQL()} $keyWord $conditionSQL"

  fun containsTable(table: AnyTable): Boolean = leftPart.table == table || rightPart.table == table

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy