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
e4af8797
Commit
e4af8797
authored
Sep 13, 2018
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改BUG
parent
64ad0b4d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
Util.java
src/main/java/com/egolm/common/Util.java
+5
-2
JdbcTemplate.java
src/main/java/com/egolm/common/jdbc/JdbcTemplate.java
+2
-0
No files found.
src/main/java/com/egolm/common/Util.java
View file @
e4af8797
...
@@ -109,7 +109,8 @@ public class Util {
...
@@ -109,7 +109,8 @@ public class Util {
}
}
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
new
ReflectException
(
e
);
e
.
printStackTrace
();
throw
new
ReflectException
(
""
,
e
);
}
}
return
bean
;
return
bean
;
}
}
...
@@ -181,7 +182,7 @@ public class Util {
...
@@ -181,7 +182,7 @@ public class Util {
* @param clz 要求转换的对象格式
* @param clz 要求转换的对象格式
* @return
* @return
*/
*/
@SuppressWarnings
(
"unchecked"
)
@SuppressWarnings
(
{
"unchecked"
,
"rawtypes"
}
)
public
static
<
T
>
T
objTo
(
Object
obj
,
Class
<
T
>
clz
)
{
public
static
<
T
>
T
objTo
(
Object
obj
,
Class
<
T
>
clz
)
{
if
(
clz
==
String
.
class
)
{
if
(
clz
==
String
.
class
)
{
return
(
T
)
String
.
valueOf
(
obj
);
return
(
T
)
String
.
valueOf
(
obj
);
...
@@ -225,6 +226,8 @@ public class Util {
...
@@ -225,6 +226,8 @@ public class Util {
return
(
T
)
toBoolean
(
obj
);
return
(
T
)
toBoolean
(
obj
);
}
else
if
(
clz
==
Map
.
class
||
clz
==
HashMap
.
class
||
clz
==
TreeMap
.
class
)
{
}
else
if
(
clz
==
Map
.
class
||
clz
==
HashMap
.
class
||
clz
==
TreeMap
.
class
)
{
return
(
T
)
toMap
(
obj
);
return
(
T
)
toMap
(
obj
);
}
else
if
(
clz
.
isEnum
())
{
return
(
T
)
Enum
.
valueOf
((
Class
<
Enum
>)
clz
,
obj
.
toString
());
}
else
{
}
else
{
return
(
T
)
obj
;
return
(
T
)
obj
;
}
}
...
...
src/main/java/com/egolm/common/jdbc/JdbcTemplate.java
View file @
e4af8797
...
@@ -245,6 +245,8 @@ public class JdbcTemplate extends org.springframework.jdbc.core.JdbcTemplate {
...
@@ -245,6 +245,8 @@ public class JdbcTemplate extends org.springframework.jdbc.core.JdbcTemplate {
if
(
argObj
instanceof
java
.
util
.
Date
)
{
if
(
argObj
instanceof
java
.
util
.
Date
)
{
java
.
util
.
Date
argDate
=
(
java
.
util
.
Date
)
argObj
;
java
.
util
.
Date
argDate
=
(
java
.
util
.
Date
)
argObj
;
ps
.
setObject
(
i
+
1
,
new
java
.
sql
.
Timestamp
(
argDate
.
getTime
()));
ps
.
setObject
(
i
+
1
,
new
java
.
sql
.
Timestamp
(
argDate
.
getTime
()));
}
else
if
(
argObj
.
getClass
().
isEnum
())
{
ps
.
setObject
(
i
+
1
,
args
[
i
].
toString
());
}
else
{
}
else
{
ps
.
setObject
(
i
+
1
,
args
[
i
]);
ps
.
setObject
(
i
+
1
,
args
[
i
]);
}
}
...
...
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