Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
C
common
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
曲欣亮
common
Commits
d6d27e68
Commit
d6d27e68
authored
Nov 24, 2018
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
28f9bf78
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
JdbcTemplate.java
src/main/java/com/egolm/common/jdbc/JdbcTemplate.java
+8
-3
No files found.
src/main/java/com/egolm/common/jdbc/JdbcTemplate.java
View file @
d6d27e68
package
com
.
egolm
.
common
.
jdbc
;
package
com
.
egolm
.
common
.
jdbc
;
import
java.beans.MethodDescriptor
;
import
java.lang.reflect.Field
;
import
java.lang.reflect.Field
;
import
java.lang.reflect.Modifier
;
import
java.sql.CallableStatement
;
import
java.sql.CallableStatement
;
import
java.sql.Connection
;
import
java.sql.Connection
;
import
java.sql.PreparedStatement
;
import
java.sql.PreparedStatement
;
...
@@ -207,9 +209,12 @@ public class JdbcTemplate extends org.springframework.jdbc.core.JdbcTemplate {
...
@@ -207,9 +209,12 @@ public class JdbcTemplate extends org.springframework.jdbc.core.JdbcTemplate {
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
Field
[]
fields
=
obj
.
getClass
().
getDeclaredFields
();
Field
[]
fields
=
obj
.
getClass
().
getDeclaredFields
();
for
(
Field
field
:
fields
)
{
for
(
Field
field
:
fields
)
{
Object
fieldValue
=
ReflexUtil
.
getFieldValue
(
field
,
obj
);
int
mod
=
field
.
getModifiers
();
if
(
fieldValue
!=
null
)
{
if
(!
Modifier
.
isStatic
(
mod
)
&&
!
Modifier
.
isFinal
(
mod
))
{
map
.
put
(
field
.
getName
(),
fieldValue
);
Object
fieldValue
=
ReflexUtil
.
getFieldValue
(
field
,
obj
);
if
(
fieldValue
!=
null
)
{
map
.
put
(
field
.
getName
(),
fieldValue
);
}
}
}
}
}
return
this
.
updateByColumn
(
iSql
.
getName
(),
iSql
.
getColumnPkNames
(),
map
);
return
this
.
updateByColumn
(
iSql
.
getName
(),
iSql
.
getColumnPkNames
(),
map
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment