File tree Expand file tree Collapse file tree 4 files changed +8
-8
lines changed
src/main/java/org/mybatis/dynamic/sql Expand file tree Collapse file tree 4 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 22
22
public abstract class RenderingStrategy {
23
23
public static final RenderingStrategy MYBATIS3 = new MyBatis3RenderingStrategy ();
24
24
public static final RenderingStrategy SPRING_NAMED_PARAMETER = new SpringNamedParameterRenderingStrategy ();
25
+ public static final String DEFAULT_PARAMETER_PREFIX = "parameters" ; //$NON-NLS-1$
25
26
26
27
public String getFormattedJdbcPlaceholder (BindableColumn <?> column , String prefix , String parameterName ) {
27
28
return getFormattedJdbcPlaceholder (Optional .of (column ), prefix , parameterName );
Original file line number Diff line number Diff line change @@ -79,13 +79,13 @@ private String orderByPhrase(SortSpecification column) {
79
79
}
80
80
81
81
private String renderLimit (Map <String , Object > parameters , Long limit ) {
82
- String placeholder = renderingStrategy .getFormattedJdbcPlaceholder ("parameters" , LIMIT_PARAMETER ); //$NON-NLS-1$
82
+ String placeholder = renderingStrategy .getFormattedJdbcPlaceholder (RenderingStrategy . DEFAULT_PARAMETER_PREFIX , LIMIT_PARAMETER );
83
83
parameters .put (LIMIT_PARAMETER , limit );
84
84
return "limit " + placeholder ; //$NON-NLS-1$
85
85
}
86
86
87
87
private String renderOffset (Map <String , Object > parameters , Long offset ) {
88
- String placeholder = renderingStrategy .getFormattedJdbcPlaceholder ("parameters" , OFFSET_PARAMETER ); //$NON-NLS-1$
88
+ String placeholder = renderingStrategy .getFormattedJdbcPlaceholder (RenderingStrategy . DEFAULT_PARAMETER_PREFIX , OFFSET_PARAMETER );
89
89
parameters .put (OFFSET_PARAMETER , offset );
90
90
return "offset " + placeholder ; //$NON-NLS-1$
91
91
}
Original file line number Diff line number Diff line change 1
1
/**
2
- * Copyright 2016-2018 the original author or authors.
2
+ * Copyright 2016-2019 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -111,6 +111,6 @@ public FragmentAndParameters visit(ColumnMapping mapping) {
111
111
112
112
private Function <SqlColumn <?>, String > toJdbcPlaceholder (String parameterName ) {
113
113
return column -> renderingStrategy
114
- .getFormattedJdbcPlaceholder (column , "parameters" , parameterName ); //$NON-NLS-1$
114
+ .getFormattedJdbcPlaceholder (column , RenderingStrategy . DEFAULT_PARAMETER_PREFIX , parameterName );
115
115
}
116
116
}
Original file line number Diff line number Diff line change 1
1
/**
2
- * Copyright 2016-2018 the original author or authors.
2
+ * Copyright 2016-2019 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -142,12 +142,11 @@ public static <T> Builder<T> withColumn(BindableColumn<T> column) {
142
142
}
143
143
144
144
public static class Builder <T > {
145
- private static final String DEFAULT_PARAMETER_PREFIX = "parameters" ; //$NON-NLS-1$
146
145
private RenderingStrategy renderingStrategy ;
147
146
private AtomicInteger sequence ;
148
147
private BindableColumn <T > column ;
149
148
private TableAliasCalculator tableAliasCalculator ;
150
- private String parameterPrefix = DEFAULT_PARAMETER_PREFIX ;
149
+ private String parameterPrefix = RenderingStrategy . DEFAULT_PARAMETER_PREFIX ;
151
150
152
151
public Builder <T > withSequence (AtomicInteger sequence ) {
153
152
this .sequence = sequence ;
@@ -171,7 +170,7 @@ public Builder<T> withTableAliasCalculator(TableAliasCalculator tableAliasCalcul
171
170
172
171
public Builder <T > withParameterName (String parameterName ) {
173
172
if (parameterName != null ) {
174
- parameterPrefix = parameterName + "." + DEFAULT_PARAMETER_PREFIX ; //$NON-NLS-1$
173
+ parameterPrefix = parameterName + "." + RenderingStrategy . DEFAULT_PARAMETER_PREFIX ; //$NON-NLS-1$
175
174
}
176
175
return this ;
177
176
}
You can’t perform that action at this time.
0 commit comments