Skip to content

Commit 08c7f98

Browse files
committed
Merge pull request #630 from kazuki43zoo/improve-doc
Fix to use bind variable(#{..}) in statement-builders.xml
2 parents 2c61e6e + c9a8f39 commit 08c7f98

File tree

5 files changed

+55
-55
lines changed

5 files changed

+55
-55
lines changed

src/site/es/xdoc/statement-builders.xml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -87,16 +87,16 @@ private String selectPersonSql() {
8787
public String deletePersonSql() {
8888
return new SQL() {{
8989
DELETE_FROM("PERSON");
90-
WHERE("ID = ${id}");
90+
WHERE("ID = #{id}");
9191
}}.toString();
9292
}
9393
9494
// Builder / Fluent style
9595
public String insertPersonSql() {
9696
String sql = new SQL()
9797
.INSERT_INTO("PERSON")
98-
.VALUES("ID, FIRST_NAME", "${id}, ${firstName}")
99-
.VALUES("LAST_NAME", "${lastName}")
98+
.VALUES("ID, FIRST_NAME", "#{id}, #{firstName}")
99+
.VALUES("LAST_NAME", "#{lastName}")
100100
.toString();
101101
return sql;
102102
}
@@ -107,13 +107,13 @@ public String selectPersonLike(final String id, final String firstName, final St
107107
SELECT("P.ID, P.USERNAME, P.PASSWORD, P.FIRST_NAME, P.LAST_NAME");
108108
FROM("PERSON P");
109109
if (id != null) {
110-
WHERE("P.ID like ${id}");
110+
WHERE("P.ID like #{id}");
111111
}
112112
if (firstName != null) {
113-
WHERE("P.FIRST_NAME like ${firstName}");
113+
WHERE("P.FIRST_NAME like #{firstName}");
114114
}
115115
if (lastName != null) {
116-
WHERE("P.LAST_NAME like ${lastName}");
116+
WHERE("P.LAST_NAME like #{lastName}");
117117
}
118118
ORDER_BY("P.LAST_NAME");
119119
}}.toString();
@@ -122,23 +122,23 @@ public String selectPersonLike(final String id, final String firstName, final St
122122
public String deletePersonSql() {
123123
return new SQL() {{
124124
DELETE_FROM("PERSON");
125-
WHERE("ID = ${id}");
125+
WHERE("ID = #{id}");
126126
}}.toString();
127127
}
128128
129129
public String insertPersonSql() {
130130
return new SQL() {{
131131
INSERT_INTO("PERSON");
132-
VALUES("ID, FIRST_NAME", "${id}, ${firstName}");
133-
VALUES("LAST_NAME", "${lastName}");
132+
VALUES("ID, FIRST_NAME", "#{id}, #{firstName}");
133+
VALUES("LAST_NAME", "#{lastName}");
134134
}}.toString();
135135
}
136136
137137
public String updatePersonSql() {
138138
return new SQL() {{
139139
UPDATE("PERSON");
140-
SET("FIRST_NAME = ${firstName}");
141-
WHERE("ID = ${id}");
140+
SET("FIRST_NAME = #{firstName}");
141+
WHERE("ID = #{id}");
142142
}}.toString();
143143
}
144144
]]></source>

src/site/ja/xdoc/statement-builders.xml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -93,16 +93,16 @@ private String selectPersonSql() {
9393
public String deletePersonSql() {
9494
return new SQL() {{
9595
DELETE_FROM("PERSON");
96-
WHERE("ID = ${id}");
96+
WHERE("ID = #{id}");
9797
}}.toString();
9898
}
9999
100100
// メソッドチェーン(Builder / Fluent スタイル)
101101
public String insertPersonSql() {
102102
String sql = new SQL()
103103
.INSERT_INTO("PERSON")
104-
.VALUES("ID, FIRST_NAME", "${id}, ${firstName}")
105-
.VALUES("LAST_NAME", "${lastName}")
104+
.VALUES("ID, FIRST_NAME", "#{id}, #{firstName}")
105+
.VALUES("LAST_NAME", "#{lastName}")
106106
.toString();
107107
return sql;
108108
}
@@ -113,13 +113,13 @@ public String selectPersonLike(final String id, final String firstName, final St
113113
SELECT("P.ID, P.USERNAME, P.PASSWORD, P.FIRST_NAME, P.LAST_NAME");
114114
FROM("PERSON P");
115115
if (id != null) {
116-
WHERE("P.ID like ${id}");
116+
WHERE("P.ID like #{id}");
117117
}
118118
if (firstName != null) {
119-
WHERE("P.FIRST_NAME like ${firstName}");
119+
WHERE("P.FIRST_NAME like #{firstName}");
120120
}
121121
if (lastName != null) {
122-
WHERE("P.LAST_NAME like ${lastName}");
122+
WHERE("P.LAST_NAME like #{lastName}");
123123
}
124124
ORDER_BY("P.LAST_NAME");
125125
}}.toString();
@@ -128,23 +128,23 @@ public String selectPersonLike(final String id, final String firstName, final St
128128
public String deletePersonSql() {
129129
return new SQL() {{
130130
DELETE_FROM("PERSON");
131-
WHERE("ID = ${id}");
131+
WHERE("ID = #{id}");
132132
}}.toString();
133133
}
134134
135135
public String insertPersonSql() {
136136
return new SQL() {{
137137
INSERT_INTO("PERSON");
138-
VALUES("ID, FIRST_NAME", "${id}, ${firstName}");
139-
VALUES("LAST_NAME", "${lastName}");
138+
VALUES("ID, FIRST_NAME", "#{id}, #{firstName}");
139+
VALUES("LAST_NAME", "#{lastName}");
140140
}}.toString();
141141
}
142142
143143
public String updatePersonSql() {
144144
return new SQL() {{
145145
UPDATE("PERSON");
146-
SET("FIRST_NAME = ${firstName}");
147-
WHERE("ID = ${id}");
146+
SET("FIRST_NAME = #{firstName}");
147+
WHERE("ID = #{id}");
148148
}}.toString();
149149
}
150150

src/site/ko/xdoc/statement-builders.xml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -99,16 +99,16 @@ private String selectPersonSql() {
9999
public String deletePersonSql() {
100100
return new SQL() {{
101101
DELETE_FROM("PERSON");
102-
WHERE("ID = ${id}");
102+
WHERE("ID = #{id}");
103103
}}.toString();
104104
}
105105
106106
// 빌더 / 깔끔한 형태
107107
public String insertPersonSql() {
108108
String sql = new SQL()
109109
.INSERT_INTO("PERSON");
110-
.VALUES("ID, FIRST_NAME", "${id}, ${firstName}");
111-
.VALUES("LAST_NAME", "${lastName}")
110+
.VALUES("ID, FIRST_NAME", "#{id}, #{firstName}");
111+
.VALUES("LAST_NAME", "#{lastName}")
112112
.toString();
113113
return sql;
114114
}
@@ -119,13 +119,13 @@ public String selectPersonLike(final String id, final String firstName, final St
119119
SELECT("P.ID, P.USERNAME, P.PASSWORD, P.FIRST_NAME, P.LAST_NAME");
120120
FROM("PERSON P");
121121
if (id != null) {
122-
WHERE("P.ID like ${id}");
122+
WHERE("P.ID like #{id}");
123123
}
124124
if (firstName != null) {
125-
WHERE("P.FIRST_NAME like ${firstName}");
125+
WHERE("P.FIRST_NAME like #{firstName}");
126126
}
127127
if (lastName != null) {
128-
WHERE("P.LAST_NAME like ${lastName}");
128+
WHERE("P.LAST_NAME like #{lastName}");
129129
}
130130
ORDER_BY("P.LAST_NAME");
131131
}}.toString();
@@ -134,23 +134,23 @@ public String selectPersonLike(final String id, final String firstName, final St
134134
public String deletePersonSql() {
135135
return new SQL() {{
136136
DELETE_FROM("PERSON");
137-
WHERE("ID = ${id}");
137+
WHERE("ID = #{id}");
138138
}}.toString();
139139
}
140140
141141
public String insertPersonSql() {
142142
return new SQL() {{
143143
INSERT_INTO("PERSON");
144-
VALUES("ID, FIRST_NAME", "${id}, ${firstName}");
145-
VALUES("LAST_NAME", "${lastName}");
144+
VALUES("ID, FIRST_NAME", "#{id}, #{firstName}");
145+
VALUES("LAST_NAME", "#{lastName}");
146146
}}.toString();
147147
}
148148
149149
public String updatePersonSql() {
150150
return new SQL() {{
151151
UPDATE("PERSON");
152-
SET("FIRST_NAME = ${firstName}");
153-
WHERE("ID = ${id}");
152+
SET("FIRST_NAME = #{firstName}");
153+
WHERE("ID = #{id}");
154154
}}.toString();
155155
}
156156
]]></source>

src/site/xdoc/statement-builders.xml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -97,16 +97,16 @@ private String selectPersonSql() {
9797
public String deletePersonSql() {
9898
return new SQL() {{
9999
DELETE_FROM("PERSON");
100-
WHERE("ID = ${id}");
100+
WHERE("ID = #{id}");
101101
}}.toString();
102102
}
103103
104104
// Builder / Fluent style
105105
public String insertPersonSql() {
106106
String sql = new SQL()
107107
.INSERT_INTO("PERSON")
108-
.VALUES("ID, FIRST_NAME", "${id}, ${firstName}")
109-
.VALUES("LAST_NAME", "${lastName}")
108+
.VALUES("ID, FIRST_NAME", "#{id}, #{firstName}")
109+
.VALUES("LAST_NAME", "#{lastName}")
110110
.toString();
111111
return sql;
112112
}
@@ -117,13 +117,13 @@ public String selectPersonLike(final String id, final String firstName, final St
117117
SELECT("P.ID, P.USERNAME, P.PASSWORD, P.FIRST_NAME, P.LAST_NAME");
118118
FROM("PERSON P");
119119
if (id != null) {
120-
WHERE("P.ID like ${id}");
120+
WHERE("P.ID like #{id}");
121121
}
122122
if (firstName != null) {
123-
WHERE("P.FIRST_NAME like ${firstName}");
123+
WHERE("P.FIRST_NAME like #{firstName}");
124124
}
125125
if (lastName != null) {
126-
WHERE("P.LAST_NAME like ${lastName}");
126+
WHERE("P.LAST_NAME like #{lastName}");
127127
}
128128
ORDER_BY("P.LAST_NAME");
129129
}}.toString();
@@ -132,23 +132,23 @@ public String selectPersonLike(final String id, final String firstName, final St
132132
public String deletePersonSql() {
133133
return new SQL() {{
134134
DELETE_FROM("PERSON");
135-
WHERE("ID = ${id}");
135+
WHERE("ID = #{id}");
136136
}}.toString();
137137
}
138138
139139
public String insertPersonSql() {
140140
return new SQL() {{
141141
INSERT_INTO("PERSON");
142-
VALUES("ID, FIRST_NAME", "${id}, ${firstName}");
143-
VALUES("LAST_NAME", "${lastName}");
142+
VALUES("ID, FIRST_NAME", "#{id}, #{firstName}");
143+
VALUES("LAST_NAME", "#{lastName}");
144144
}}.toString();
145145
}
146146
147147
public String updatePersonSql() {
148148
return new SQL() {{
149149
UPDATE("PERSON");
150-
SET("FIRST_NAME = ${firstName}");
151-
WHERE("ID = ${id}");
150+
SET("FIRST_NAME = #{firstName}");
151+
WHERE("ID = #{id}");
152152
}}.toString();
153153
}
154154
]]></source>

src/site/zh/xdoc/statement-builders.xml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -87,16 +87,16 @@ private String selectPersonSql() {
8787
public String deletePersonSql() {
8888
return new SQL() {{
8989
DELETE_FROM("PERSON");
90-
WHERE("ID = ${id}");
90+
WHERE("ID = #{id}");
9191
}}.toString();
9292
}
9393
9494
// Builder / Fluent style
9595
public String insertPersonSql() {
9696
String sql = new SQL()
9797
.INSERT_INTO("PERSON")
98-
.VALUES("ID, FIRST_NAME", "${id}, ${firstName}")
99-
.VALUES("LAST_NAME", "${lastName}")
98+
.VALUES("ID, FIRST_NAME", "#{id}, #{firstName}")
99+
.VALUES("LAST_NAME", "#{lastName}")
100100
.toString();
101101
return sql;
102102
}
@@ -107,13 +107,13 @@ public String selectPersonLike(final String id, final String firstName, final St
107107
SELECT("P.ID, P.USERNAME, P.PASSWORD, P.FIRST_NAME, P.LAST_NAME");
108108
FROM("PERSON P");
109109
if (id != null) {
110-
WHERE("P.ID like ${id}");
110+
WHERE("P.ID like #{id}");
111111
}
112112
if (firstName != null) {
113-
WHERE("P.FIRST_NAME like ${firstName}");
113+
WHERE("P.FIRST_NAME like #{firstName}");
114114
}
115115
if (lastName != null) {
116-
WHERE("P.LAST_NAME like ${lastName}");
116+
WHERE("P.LAST_NAME like #{lastName}");
117117
}
118118
ORDER_BY("P.LAST_NAME");
119119
}}.toString();
@@ -122,23 +122,23 @@ public String selectPersonLike(final String id, final String firstName, final St
122122
public String deletePersonSql() {
123123
return new SQL() {{
124124
DELETE_FROM("PERSON");
125-
WHERE("ID = ${id}");
125+
WHERE("ID = #{id}");
126126
}}.toString();
127127
}
128128
129129
public String insertPersonSql() {
130130
return new SQL() {{
131131
INSERT_INTO("PERSON");
132-
VALUES("ID, FIRST_NAME", "${id}, ${firstName}");
133-
VALUES("LAST_NAME", "${lastName}");
132+
VALUES("ID, FIRST_NAME", "#{id}, #{firstName}");
133+
VALUES("LAST_NAME", "#{lastName}");
134134
}}.toString();
135135
}
136136
137137
public String updatePersonSql() {
138138
return new SQL() {{
139139
UPDATE("PERSON");
140-
SET("FIRST_NAME = ${firstName}");
141-
WHERE("ID = ${id}");
140+
SET("FIRST_NAME = #{firstName}");
141+
WHERE("ID = #{id}");
142142
}}.toString();
143143
}
144144
]]></source>

0 commit comments

Comments
 (0)