Skip to content

Commit c022349

Browse files
committed
Remove Deprecated Kotlin Join Methods
1 parent 70e6d3b commit c022349

File tree

2 files changed

+0
-42
lines changed

2 files changed

+0
-42
lines changed

src/main/kotlin/org/mybatis/dynamic/sql/util/kotlin/JoinCollector.kt

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -48,26 +48,6 @@ class JoinCollector {
4848
.build()
4949
)
5050
}
51-
52-
@Deprecated("Please use: on(leftColumn) equalTo rightColumn")
53-
fun on(column: BasicColumn, condition: JoinCondition) {
54-
onJoinCriterion = JoinCriterion.Builder()
55-
.withConnector("on") //$NON-NLS-1$
56-
.withJoinColumn(column)
57-
.withJoinCondition(condition)
58-
.build()
59-
}
60-
61-
@Deprecated("Please use: and(leftColumn) equalTo rightColumn")
62-
fun and(column: BasicColumn, condition: JoinCondition) {
63-
andJoinCriteria.add(
64-
JoinCriterion.Builder()
65-
.withConnector("and") //$NON-NLS-1$
66-
.withJoinColumn(column)
67-
.withJoinCondition(condition)
68-
.build()
69-
)
70-
}
7151
}
7252

7353
class RightColumnCollector(private val joinConditionConsumer: (JoinCondition) -> Unit) {

src/test/kotlin/examples/kotlin/mybatis3/joins/JoinMapperTest.kt

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import org.junit.jupiter.api.Test
3030
import org.junit.jupiter.api.TestInstance
3131
import org.mybatis.dynamic.sql.util.Messages
3232
import org.mybatis.dynamic.sql.util.kotlin.KInvalidSQLException
33-
import org.mybatis.dynamic.sql.util.kotlin.elements.equalTo
3433
import org.mybatis.dynamic.sql.util.kotlin.elements.invoke
3534
import org.mybatis.dynamic.sql.util.kotlin.elements.max
3635
import org.mybatis.dynamic.sql.util.kotlin.mybatis3.select
@@ -127,27 +126,6 @@ class JoinMapperTest {
127126
assertThat(selectStatement.selectStatement).isEqualTo(expectedStatement)
128127
}
129128

130-
@Test
131-
fun testDeprecatedJoin() {
132-
// this is a nonsensical join, but it does test the "and" capability
133-
val selectStatement = select(
134-
orderMaster.orderId, orderMaster.orderDate, orderDetail.lineNumber,
135-
orderDetail.description, orderDetail.quantity
136-
) {
137-
from(orderMaster, "om")
138-
join(orderDetail, "od") {
139-
on(orderMaster.orderId, equalTo(orderDetail.orderId))
140-
and(orderMaster.orderId, equalTo(orderDetail.orderId))
141-
}
142-
where { orderMaster.orderId isEqualTo 1 }
143-
}
144-
145-
val expectedStatement = "select om.order_id, om.order_date, od.line_number, od.description, od.quantity" +
146-
" from OrderMaster om join OrderDetail od on om.order_id = od.order_id and om.order_id = od.order_id" +
147-
" where om.order_id = #{parameters.p1,jdbcType=INTEGER}"
148-
assertThat(selectStatement.selectStatement).isEqualTo(expectedStatement)
149-
}
150-
151129
@Test
152130
fun testMultipleTableJoinWithWhereClause() {
153131
sqlSessionFactory.openSession().use { session ->

0 commit comments

Comments
 (0)