Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
Y
yzg-util
Project
Project
Details
Activity
Releases
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
YZG
yzg-util
Commits
1d87feb8
Commit
1d87feb8
authored
Nov 05, 2021
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改实例化关系
parent
820d4d73
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
2 deletions
+24
-2
MemoryCache.java
...src/main/java/com/yanzuoguang/util/cache/MemoryCache.java
+14
-2
TestDbPrintSql.java
yzg-util-db/src/test/java/TestDbPrintSql.java
+10
-0
No files found.
yzg-util-base/src/main/java/com/yanzuoguang/util/cache/MemoryCache.java
View file @
1d87feb8
...
...
@@ -2,8 +2,7 @@ package com.yanzuoguang.util.cache;
import
com.yanzuoguang.util.helper.StringHelper
;
import
java.util.Date
;
import
java.util.Map
;
import
java.util.*
;
import
java.util.concurrent.ConcurrentHashMap
;
/**
...
...
@@ -216,6 +215,19 @@ public class MemoryCache<T> {
MemoryCacheCenter
.
CLEAR_LIST
.
remove
(
this
);
}
/**
* 获取所有的关键字
*
* @return
*/
public
synchronized
Collection
<
T
>
getValues
()
{
List
<
T
>
list
=
new
ArrayList
<>();
for
(
MemoryCacheItem
<
T
>
item:
cache
.
values
()){
list
.
add
(
item
.
getData
());
}
return
list
;
}
/**
* 获取所有的关键字
*
...
...
yzg-util-db/src/test/java/TestDbPrintSql.java
View file @
1d87feb8
...
...
@@ -24,4 +24,14 @@ public class TestDbPrintSql {
SqlData
sqlData
=
cache
.
getNameCache
().
get
(
DaoConst
.
GROUP_ADD
);
System
.
out
.
println
(
JsonHelper
.
serialize
(
sqlData
,
true
));
}
@Test
public
void
testTable
()
{
TableSqlCache
cache
=
new
TableSqlCache
();
TableStruct
table
=
new
TableStruct
(
"test"
,
TestTableGroupVo
.
class
);
table
.
init
(
cache
);
System
.
out
.
println
(
JsonHelper
.
serialize
(
cache
.
getNameCache
(),
true
));
}
}
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