Skip to content

Commit c46d6d4

Browse files
committed
Remove deprecated code
1 parent f86d11d commit c46d6d4

File tree

5 files changed

+0
-163
lines changed

5 files changed

+0
-163
lines changed

src/main/java/org/mybatis/dynamic/sql/where/condition/IsIn.java

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -54,23 +54,6 @@ public IsIn<T> then(UnaryOperator<Stream<T>> valueStreamTransformer) {
5454
return new IsIn<>(values, valueStreamTransformer);
5555
}
5656

57-
/**
58-
* This method allows you to modify the condition's values before they are placed into the parameter map.
59-
* For example, you could filter nulls, or trim strings, etc. This process will run before final rendering of SQL.
60-
* If you filter values out of the stream, then final condition will not reference those values. If you filter all
61-
* values out of the stream, then the condition will not render.
62-
*
63-
* @param valueStreamTransformer a UnaryOperator that will transform the value stream before
64-
* the values are placed in the parameter map
65-
* @return new condition with the specified transformer
66-
*
67-
* @deprecated See {@link IsIn#then(UnaryOperator)}
68-
*/
69-
@Deprecated
70-
public IsIn<T> withValueStreamOperations(UnaryOperator<Stream<T>> valueStreamTransformer) {
71-
return then(valueStreamTransformer);
72-
}
73-
7457
public static <T> IsIn<T> of(Collection<T> values) {
7558
return new IsIn<>(values);
7659
}

src/main/java/org/mybatis/dynamic/sql/where/condition/IsInCaseInsensitive.java

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -53,23 +53,6 @@ public IsInCaseInsensitive then(UnaryOperator<Stream<String>> valueStreamTransfo
5353
return new IsInCaseInsensitive(values, valueStreamTransformer);
5454
}
5555

56-
/**
57-
* This method allows you to modify the condition's values before they are placed into the parameter map.
58-
* For example, you could filter nulls, or trim strings, etc. This process will run before final rendering of SQL.
59-
* If you filter values out of the stream, then final condition will not reference those values. If you filter all
60-
* values out of the stream, then the condition will not render.
61-
*
62-
* @param valueStreamTransformer a UnaryOperator that will transform the value stream before
63-
* the values are placed in the parameter map
64-
* @return new condition with the specified transformer
65-
*
66-
* @deprecated See {@link IsInCaseInsensitive#then(UnaryOperator)}
67-
*/
68-
@Deprecated
69-
public IsInCaseInsensitive withValueStreamOperations(UnaryOperator<Stream<String>> valueStreamTransformer) {
70-
return then(valueStreamTransformer);
71-
}
72-
7356
public static IsInCaseInsensitive of(Collection<String> values) {
7457
return new IsInCaseInsensitive(values);
7558
}

src/main/java/org/mybatis/dynamic/sql/where/condition/IsNotIn.java

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -55,23 +55,6 @@ public IsNotIn<T> then(UnaryOperator<Stream<T>> valueStreamTransformer) {
5555
return new IsNotIn<>(values, valueStreamTransformer);
5656
}
5757

58-
/**
59-
* This method allows you to modify the condition's values before they are placed into the parameter map.
60-
* For example, you could filter nulls, or trim strings, etc. This process will run before final rendering of SQL.
61-
* If you filter values out of the stream, then final condition will not reference those values. If you filter all
62-
* values out of the stream, then the condition will not render.
63-
*
64-
* @param valueStreamTransformer a UnaryOperator that will transform the value stream before
65-
* the values are placed in the parameter map
66-
* @return new condition with the specified transformer
67-
*
68-
* @deprecated See {@link IsNotIn#then(UnaryOperator)}
69-
*/
70-
@Deprecated
71-
public IsNotIn<T> withValueStreamOperations(UnaryOperator<Stream<T>> valueStreamTransformer) {
72-
return then(valueStreamTransformer);
73-
}
74-
7558
public static <T> IsNotIn<T> of(Collection<T> values) {
7659
return new IsNotIn<>(values);
7760
}

src/main/java/org/mybatis/dynamic/sql/where/condition/IsNotInCaseInsensitive.java

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -54,23 +54,6 @@ public IsNotInCaseInsensitive then(UnaryOperator<Stream<String>> valueStreamTran
5454
return new IsNotInCaseInsensitive(values, valueStreamTransformer);
5555
}
5656

57-
/**
58-
* This method allows you to modify the condition's values before they are placed into the parameter map.
59-
* For example, you could filter nulls, or trim strings, etc. This process will run before final rendering of SQL.
60-
* If you filter values out of the stream, then final condition will not reference those values. If you filter all
61-
* values out of the stream, then the condition will not render.
62-
*
63-
* @param valueStreamTransformer a UnaryOperator that will transform the value stream before
64-
* the values are placed in the parameter map
65-
* @return new condition with the specified transformer
66-
*
67-
* @deprecated See {@link IsNotInCaseInsensitive#then(UnaryOperator)}
68-
*/
69-
@Deprecated
70-
public IsNotInCaseInsensitive withValueStreamOperations(UnaryOperator<Stream<String>> valueStreamTransformer) {
71-
return then(valueStreamTransformer);
72-
}
73-
7457
public static IsNotInCaseInsensitive of(Collection<String> values) {
7558
return new IsNotInCaseInsensitive(values);
7659
}

src/test/java/examples/animal/data/OptionalConditionsWithPredicatesAnimalDataTest.java

Lines changed: 0 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -454,30 +454,6 @@ public void testIsInWhenWithSomeValues() {
454454
}
455455
}
456456

457-
/**
458-
* Delete this test when the deprecated method is deleted
459-
*/
460-
@Test
461-
@Deprecated
462-
public void testIsInWhenWithSomeValuesDeprecated() {
463-
try (SqlSession sqlSession = sqlSessionFactory.openSession()) {
464-
AnimalDataMapper mapper = sqlSession.getMapper(AnimalDataMapper.class);
465-
SelectStatementProvider selectStatement = select(id, animalName, bodyWeight, brainWeight)
466-
.from(animalData)
467-
.where(id, isIn(3, NULL_INTEGER, 5).withValueStreamOperations(s -> s.filter(Objects::nonNull).map(i -> i + 3)))
468-
.orderBy(id)
469-
.build()
470-
.render(RenderingStrategy.MYBATIS3);
471-
List<AnimalData> animals = mapper.selectMany(selectStatement);
472-
assertAll(
473-
() -> assertThat(selectStatement.getSelectStatement()).isEqualTo("select id, animal_name, body_weight, brain_weight from AnimalData where id in (#{parameters.p1,jdbcType=INTEGER},#{parameters.p2,jdbcType=INTEGER}) order by id"),
474-
() -> assertThat(animals.size()).isEqualTo(2),
475-
() -> assertThat(animals.get(0).getId()).isEqualTo(6),
476-
() -> assertThat(animals.get(1).getId()).isEqualTo(8)
477-
);
478-
}
479-
}
480-
481457
@Test
482458
public void testIsInCaseInsensitiveWhenWithValue() {
483459
try (SqlSession sqlSession = sqlSessionFactory.openSession()) {
@@ -557,29 +533,6 @@ public void testIsInCaseInsensitiveWhenWithSomeValues() {
557533
}
558534
}
559535

560-
/**
561-
* Delete this test when the deprecated method is deleted
562-
*/
563-
@Test
564-
@Deprecated
565-
public void testIsInCaseInsensitiveWhenWithSomeValuesDeprecated() {
566-
try (SqlSession sqlSession = sqlSessionFactory.openSession()) {
567-
AnimalDataMapper mapper = sqlSession.getMapper(AnimalDataMapper.class);
568-
SelectStatementProvider selectStatement = select(id, animalName, bodyWeight, brainWeight)
569-
.from(animalData)
570-
.where(animalName, isInCaseInsensitive("mouse", null, "musk shrew").withValueStreamOperations(s -> s.filter(Objects::nonNull)))
571-
.orderBy(id)
572-
.build()
573-
.render(RenderingStrategy.MYBATIS3);
574-
List<AnimalData> animals = mapper.selectMany(selectStatement);
575-
assertAll(
576-
() -> assertThat(selectStatement.getSelectStatement()).isEqualTo("select id, animal_name, body_weight, brain_weight from AnimalData where upper(animal_name) in (#{parameters.p1,jdbcType=VARCHAR},#{parameters.p2,jdbcType=VARCHAR}) order by id"),
577-
() -> assertThat(animals.size()).isEqualTo(2),
578-
() -> assertThat(animals.get(0).getId()).isEqualTo(4)
579-
);
580-
}
581-
}
582-
583536
@Test
584537
public void testIsInCaseInsensitiveWhenWithNoValues() {
585538
try (SqlSession sqlSession = sqlSessionFactory.openSession()) {
@@ -640,30 +593,6 @@ public void testIsNotInWhenWithSomeValues() {
640593
}
641594
}
642595

643-
/**
644-
* Delete this test when the deprecated method is deleted
645-
*/
646-
@Test
647-
@Deprecated
648-
public void testIsNotInWhenWithSomeValuesDeprecated() {
649-
try (SqlSession sqlSession = sqlSessionFactory.openSession()) {
650-
AnimalDataMapper mapper = sqlSession.getMapper(AnimalDataMapper.class);
651-
SelectStatementProvider selectStatement = select(id, animalName, bodyWeight, brainWeight)
652-
.from(animalData)
653-
.where(id, isNotIn(3, NULL_INTEGER, 5).withValueStreamOperations(s -> s.filter(Objects::nonNull)))
654-
.and(id, isLessThanOrEqualTo(10))
655-
.orderBy(id)
656-
.build()
657-
.render(RenderingStrategy.MYBATIS3);
658-
List<AnimalData> animals = mapper.selectMany(selectStatement);
659-
assertAll(
660-
() -> assertThat(selectStatement.getSelectStatement()).isEqualTo("select id, animal_name, body_weight, brain_weight from AnimalData where id not in (#{parameters.p1,jdbcType=INTEGER},#{parameters.p2,jdbcType=INTEGER}) and id <= #{parameters.p3,jdbcType=INTEGER} order by id"),
661-
() -> assertThat(animals.size()).isEqualTo(8),
662-
() -> assertThat(animals.get(0).getId()).isEqualTo(1)
663-
);
664-
}
665-
}
666-
667596
@Test
668597
public void testIsNotInCaseInsensitiveWhenWithValue() {
669598
try (SqlSession sqlSession = sqlSessionFactory.openSession()) {
@@ -704,30 +633,6 @@ public void testIsNotInCaseInsensitiveWhenWithSomeValues() {
704633
}
705634
}
706635

707-
/**
708-
* Delete this test when the deprecated method is deleted
709-
*/
710-
@Test
711-
@Deprecated
712-
public void testIsNotInCaseInsensitiveWhenWithSomeValuesDeprecated() {
713-
try (SqlSession sqlSession = sqlSessionFactory.openSession()) {
714-
AnimalDataMapper mapper = sqlSession.getMapper(AnimalDataMapper.class);
715-
SelectStatementProvider selectStatement = select(id, animalName, bodyWeight, brainWeight)
716-
.from(animalData)
717-
.where(animalName, isNotInCaseInsensitive("mouse", null, "musk shrew").withValueStreamOperations(s -> s.filter(Objects::nonNull)))
718-
.and(id, isLessThanOrEqualTo(10))
719-
.orderBy(id)
720-
.build()
721-
.render(RenderingStrategy.MYBATIS3);
722-
List<AnimalData> animals = mapper.selectMany(selectStatement);
723-
assertAll(
724-
() -> assertThat(selectStatement.getSelectStatement()).isEqualTo("select id, animal_name, body_weight, brain_weight from AnimalData where upper(animal_name) not in (#{parameters.p1,jdbcType=VARCHAR},#{parameters.p2,jdbcType=VARCHAR}) and id <= #{parameters.p3,jdbcType=INTEGER} order by id"),
725-
() -> assertThat(animals.size()).isEqualTo(8),
726-
() -> assertThat(animals.get(0).getId()).isEqualTo(1)
727-
);
728-
}
729-
}
730-
731636
@Test
732637
public void testIsNotInCaseInsensitiveWhenWithNoValues() {
733638
try (SqlSession sqlSession = sqlSessionFactory.openSession()) {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy