Toggle navigation
Toggle navigation
This project
Loading...
Sign in
yangyoupeng
/
microservice
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
yangyoupeng
2016-11-10 10:35:43 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
cbc3b9d155ae0cc7d7ab9c184fb03127e48d86fc
cbc3b9d1
1 parent
ce0b07bb
redis序列化修改默认key:string,value:genericJson
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
185 additions
and
14 deletions
src/microservice-parent/microservice-redis/pom.xml
src/microservice-parent/microservice-redis/src/main/java/com/zhaoonline/redis/cache/CacheOnRedis.java
src/microservice-parent/microservice-redis/src/main/java/com/zhaoonline/redis/lock/ExcludeLock.java
src/microservice-parent/microservice-redis/src/main/java/com/zhaoonline/redis/repository/DataHashRepository.java
src/microservice-parent/microservice-redis/src/main/java/com/zhaoonline/redis/repository/DataListRepository.java
src/microservice-parent/microservice-redis/src/main/java/com/zhaoonline/redis/repository/DataSetRepository.java
src/microservice-parent/microservice-redis/src/main/java/com/zhaoonline/redis/repository/DataStringRepository.java
src/microservice-parent/microservice-redis/src/main/java/com/zhaoonline/redis/repository/DataValueRepository.java
src/microservice-parent/microservice-redis/src/main/java/com/zhaoonline/redis/serialize/SafeEncodeSerializer.java
src/microservice-parent/microservice-redis/src/main/java/com/zhaoonline/redis/token/MultiSubmitToken.java
src/microservice-parent/microservice-redis/src/main/java/com/zhaoonline/redis/token/Token.java
src/microservice-parent/microservice-redis/src/test/java/com/zhaoonline/redis/repository/TestDataValueRepository.java
src/microservice-parent/microservice-redis/pom.xml
View file @
cbc3b9d
...
...
@@ -61,8 +61,18 @@
<artifactId>
spring-core
</artifactId>
</dependency>
<dependency>
<groupId>
com.fasterxml.jackson.core
</groupId>
<artifactId>
jackson-core
</artifactId>
<version>
2.8.1
</version>
</dependency>
<dependency>
<groupId>
com.fasterxml.jackson.core
</groupId>
<artifactId>
jackson-databind
</artifactId>
<version>
2.8.1
</version>
</dependency>
</dependencies>
<build>
...
...
src/microservice-parent/microservice-redis/src/main/java/com/zhaoonline/redis/cache/CacheOnRedis.java
View file @
cbc3b9d
...
...
@@ -7,9 +7,14 @@ import org.springframework.cache.Cache;
import
org.springframework.data.redis.cache.RedisCache
;
import
org.springframework.data.redis.cache.RedisCacheElement
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer
;
import
org.springframework.data.redis.serializer.RedisSerializer
;
import
com.zhaoonline.redis.serialize.SafeEncodeSerializer
;
import
com.zhaoonline.redis.template.RedisTemplateFactory
;
import
redis.clients.util.SafeEncoder
;
/**
* class name:CacheOnRedis <BR>
* class description: 基于redis的cache <BR>
...
...
@@ -33,13 +38,36 @@ public class CacheOnRedis {
* @param prefix <BR>
*/
public
CacheOnRedis
(
RedisTemplateFactory
factory
,
String
cacheName
,
byte
[]
prefix
){
// redisTemplate = factory.createTemplate();
// cache= new RedisCache(cacheName, prefix, redisTemplate, TimeUnit.MINUTES.toSeconds(10));
this
(
factory
,
cacheName
,
prefix
,
new
SafeEncodeSerializer
(),
new
GenericJackson2JsonRedisSerializer
());
}
public
CacheOnRedis
(
RedisTemplateFactory
factory
,
String
cacheName
,
byte
[]
prefix
,
RedisSerializer
keySerializer
,
RedisSerializer
valueSerializer
){
redisTemplate
=
factory
.
createTemplate
();
redisTemplate
.
setKeySerializer
(
keySerializer
);
if
(
valueSerializer
!=
null
){
redisTemplate
.
setValueSerializer
(
valueSerializer
);
}
cache
=
new
RedisCache
(
cacheName
,
prefix
,
redisTemplate
,
TimeUnit
.
MINUTES
.
toSeconds
(
10
));
}
public
CacheOnRedis
(
RedisTemplateFactory
factory
,
String
cacheName
,
byte
[]
prefix
,
long
exipreTime
){
// redisTemplate = factory.createTemplate();
// cache= new RedisCache(cacheName, prefix, redisTemplate,exipreTime);
this
(
factory
,
cacheName
,
prefix
,
exipreTime
,
new
SafeEncodeSerializer
(),
null
);
}
public
CacheOnRedis
(
RedisTemplateFactory
factory
,
String
cacheName
,
byte
[]
prefix
,
long
exipreTime
,
RedisSerializer
keySerializer
,
RedisSerializer
valueSerializer
){
redisTemplate
=
factory
.
createTemplate
();
redisTemplate
.
setKeySerializer
(
keySerializer
);
if
(
valueSerializer
!=
null
){
redisTemplate
.
setValueSerializer
(
valueSerializer
);
}
cache
=
new
RedisCache
(
cacheName
,
prefix
,
redisTemplate
,
exipreTime
);
}
/**
* Method name: put <BR>
* Description: put <BR>
...
...
src/microservice-parent/microservice-redis/src/main/java/com/zhaoonline/redis/lock/ExcludeLock.java
View file @
cbc3b9d
...
...
@@ -10,7 +10,10 @@ import org.springframework.data.redis.core.BoundValueOperations;
import
org.springframework.data.redis.core.RedisOperations
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.core.SessionCallback
;
import
org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer
;
import
org.springframework.data.redis.serializer.RedisSerializer
;
import
com.zhaoonline.redis.serialize.SafeEncodeSerializer
;
import
com.zhaoonline.redis.template.DeSerializer
;
import
com.zhaoonline.redis.template.RedisTemplateFactory
;
import
com.zhaoonline.redis.transaction.TransactionValueOperation
;
...
...
@@ -26,7 +29,7 @@ import com.zhaoonline.redis.transaction.TransactionValueOperation;
public
class
ExcludeLock
{
private
Logger
logger
=
LoggerFactory
.
getLogger
(
ExcludeLock
.
class
);
private
RedisTemplate
<
String
,
String
>
redisTemplate
;
private
DeSerializer
deSerializer
=
new
DeSerializer
();
//
private DeSerializer deSerializer = new DeSerializer();
private
static
final
String
sperator
=
":"
;
private
String
lockNamespace
=
"lock"
+
sperator
;
private
final
int
lockExpiryInMillis
;
...
...
@@ -46,22 +49,30 @@ public class ExcludeLock {
public
ExcludeLock
(
RedisTemplateFactory
factory
,
String
lockName
)
{
this
(
factory
,
lockName
,
DEFAULT_ACQUIRE_TIMEOUT_MILLIS
);
this
(
factory
,
lockName
,
new
SafeEncodeSerializer
(),
new
GenericJackson2JsonRedisSerializer
());
}
public
ExcludeLock
(
RedisTemplateFactory
factory
,
String
lockName
,
RedisSerializer
keySerializer
,
RedisSerializer
valueSerializer
)
{
this
(
factory
,
lockName
,
DEFAULT_ACQUIRE_TIMEOUT_MILLIS
,
keySerializer
,
valueSerializer
);
}
public
ExcludeLock
(
RedisTemplateFactory
factory
,
String
lockName
,
int
acquireTimeoutMillis
)
{
this
(
factory
,
lockName
,
DEFAULT_ACQUIRE_TIMEOUT_MILLIS
,
DEFAULT_EXPIRY_TIME_MILLIS
,
UUID
.
randomUUID
());
public
ExcludeLock
(
RedisTemplateFactory
factory
,
String
lockName
,
int
acquireTimeoutMillis
,
RedisSerializer
keySerializer
,
RedisSerializer
valueSerializer
)
{
this
(
factory
,
lockName
,
DEFAULT_ACQUIRE_TIMEOUT_MILLIS
,
DEFAULT_EXPIRY_TIME_MILLIS
,
UUID
.
randomUUID
()
,
keySerializer
,
valueSerializer
);
}
public
ExcludeLock
(
RedisTemplateFactory
factory
,
String
lockName
,
int
acquireTimeoutMillis
,
int
expiryTimeMillis
)
{
this
(
factory
,
lockName
,
acquireTimeoutMillis
,
expiryTimeMillis
,
UUID
.
randomUUID
());
this
(
factory
,
lockName
,
acquireTimeoutMillis
,
expiryTimeMillis
,
UUID
.
randomUUID
()
,
new
SafeEncodeSerializer
(),
new
GenericJackson2JsonRedisSerializer
()
);
}
public
ExcludeLock
(
RedisTemplateFactory
factory
,
String
lockName
,
int
acquireTimeoutMillis
,
int
expiryTimeMillis
,
UUID
uuid
)
{
UUID
uuid
,
RedisSerializer
keySerializer
,
RedisSerializer
valueSerializer
)
{
redisTemplate
=
factory
.
createTemplate
();
redisTemplate
.
setKeySerializer
(
keySerializer
);
if
(
valueSerializer
!=
null
){
redisTemplate
.
setValueSerializer
(
valueSerializer
);
}
// redisTemplate.setEnableTransactionSupport(true);
deSerializer
.
setValueSerializer
(
redisTemplate
.
getValueSerializer
());
//
deSerializer.setValueSerializer(redisTemplate.getValueSerializer());
lockExpiryInMillis
=
expiryTimeMillis
;
acquiryTimeoutInMillis
=
acquireTimeoutMillis
;
lockKeyPath
=
lockNamespace
+
lockName
;
...
...
src/microservice-parent/microservice-redis/src/main/java/com/zhaoonline/redis/repository/DataHashRepository.java
View file @
cbc3b9d
...
...
@@ -8,8 +8,11 @@ import java.util.Set;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.redis.core.BoundHashOperations
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer
;
import
org.springframework.data.redis.serializer.RedisSerializer
;
import
com.zhaoonline.redis.template.RedisTemplateFactory
;
import
com.zhaoonline.redis.serialize.SafeEncodeSerializer
;
import
com.zhaoonline.redis.template.OperationBuilder
;
/**
...
...
@@ -22,8 +25,18 @@ import com.zhaoonline.redis.template.OperationBuilder;
public
class
DataHashRepository
<
V
>
{
private
OperationBuilder
<
V
>
builder
;
private
RedisTemplate
<
String
,
V
>
redisTemplate
;
@Autowired
public
DataHashRepository
(
RedisTemplateFactory
factory
){
this
(
factory
,
new
SafeEncodeSerializer
());
}
@Autowired
public
DataHashRepository
(
RedisTemplateFactory
factory
,
RedisSerializer
keySerializer
){
this
(
factory
,
keySerializer
,
new
GenericJackson2JsonRedisSerializer
());
}
@Autowired
public
DataHashRepository
(
RedisTemplateFactory
factory
,
RedisSerializer
keySerializer
,
RedisSerializer
valueSerializer
){
builder
=
new
OperationBuilder
<
V
>(
factory
);
redisTemplate
=
builder
.
template
();
}
...
...
src/microservice-parent/microservice-redis/src/main/java/com/zhaoonline/redis/repository/DataListRepository.java
View file @
cbc3b9d
...
...
@@ -10,7 +10,10 @@ import org.springframework.data.redis.core.RedisCallback;
import
org.springframework.data.redis.core.RedisOperations
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.core.SessionCallback
;
import
org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer
;
import
org.springframework.data.redis.serializer.RedisSerializer
;
import
com.zhaoonline.redis.serialize.SafeEncodeSerializer
;
import
com.zhaoonline.redis.template.DeSerializer
;
import
com.zhaoonline.redis.template.RedisTemplateFactory
;
import
com.zhaoonline.redis.template.OperationBuilder
;
...
...
@@ -22,9 +25,21 @@ public class DataListRepository<V> {
@Autowired
public
DataListRepository
(
RedisTemplateFactory
factory
){
this
(
factory
,
new
SafeEncodeSerializer
());
}
@Autowired
public
DataListRepository
(
RedisTemplateFactory
factory
,
RedisSerializer
keySerializer
){
this
(
factory
,
keySerializer
,
new
GenericJackson2JsonRedisSerializer
());
}
@Autowired
public
DataListRepository
(
RedisTemplateFactory
factory
,
RedisSerializer
keySerializer
,
RedisSerializer
valueSerializer
){
builder
=
new
OperationBuilder
<
V
>(
factory
);
redisTemplate
=
builder
.
template
();
deSerializer
.
setValueSerializer
(
redisTemplate
.
getValueSerializer
());
redisTemplate
.
setKeySerializer
(
keySerializer
);
redisTemplate
.
setValueSerializer
(
valueSerializer
);
deSerializer
.
setValueSerializer
(
redisTemplate
.
getValueSerializer
());
}
/**
...
...
src/microservice-parent/microservice-redis/src/main/java/com/zhaoonline/redis/repository/DataSetRepository.java
View file @
cbc3b9d
...
...
@@ -12,7 +12,10 @@ import org.springframework.data.redis.core.RedisCallback;
import
org.springframework.data.redis.core.RedisOperations
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.core.SessionCallback
;
import
org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer
;
import
org.springframework.data.redis.serializer.RedisSerializer
;
import
com.zhaoonline.redis.serialize.SafeEncodeSerializer
;
import
com.zhaoonline.redis.template.DeSerializer
;
import
com.zhaoonline.redis.template.RedisTemplateFactory
;
import
com.zhaoonline.redis.template.OperationBuilder
;
...
...
@@ -24,11 +27,24 @@ public class DataSetRepository<V> {
@Autowired
public
DataSetRepository
(
RedisTemplateFactory
factory
){
this
(
factory
,
new
SafeEncodeSerializer
());
}
@Autowired
public
DataSetRepository
(
RedisTemplateFactory
factory
,
RedisSerializer
keySerializer
){
this
(
factory
,
keySerializer
,
new
GenericJackson2JsonRedisSerializer
());
}
@Autowired
public
DataSetRepository
(
RedisTemplateFactory
factory
,
RedisSerializer
keySerializer
,
RedisSerializer
valueSerializer
){
builder
=
new
OperationBuilder
<
V
>(
factory
);
redisTemplate
=
builder
.
template
();
redisTemplate
.
setKeySerializer
(
keySerializer
);
redisTemplate
.
setValueSerializer
(
valueSerializer
);
deSerializer
.
setValueSerializer
(
redisTemplate
.
getValueSerializer
());
}
/**
* Method name: set <BR>
* Description: 将values添加到key的set中,如果value已经存在了就会忽略,若key不在就会创建一个新的set <BR>
...
...
src/microservice-parent/microservice-redis/src/main/java/com/zhaoonline/redis/repository/DataStringRepository.java
View file @
cbc3b9d
...
...
@@ -8,15 +8,25 @@ import org.springframework.dao.DataAccessException;
import
org.springframework.data.redis.connection.RedisConnection
;
import
org.springframework.data.redis.core.RedisCallback
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.serializer.RedisSerializer
;
import
com.zhaoonline.redis.serialize.SafeEncodeSerializer
;
import
com.zhaoonline.redis.template.OperationBuilder
;
import
com.zhaoonline.redis.template.RedisTemplateFactory
;
public
class
DataStringRepository
{
private
RedisTemplate
<
String
,
String
>
redisTemplate
;
@Autowired
public
DataStringRepository
(
RedisTemplateFactory
factory
){
this
(
factory
,
new
SafeEncodeSerializer
(),
new
SafeEncodeSerializer
());
}
public
DataStringRepository
(
RedisTemplateFactory
factory
,
RedisSerializer
keySerializer
,
RedisSerializer
valueSerializer
){
redisTemplate
=
factory
.
createTemplate
();
redisTemplate
.
setKeySerializer
(
keySerializer
);
redisTemplate
.
setValueSerializer
(
valueSerializer
);
}
/**
* Method name: append <BR>
* Description: 将String 类型的value append到key的值之后, <BR>
...
...
src/microservice-parent/microservice-redis/src/main/java/com/zhaoonline/redis/repository/DataValueRepository.java
View file @
cbc3b9d
...
...
@@ -5,8 +5,12 @@ import java.util.concurrent.TimeUnit;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.redis.core.BoundValueOperations
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer
;
import
org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer
;
import
org.springframework.data.redis.serializer.RedisSerializer
;
import
com.zhaoonline.redis.template.RedisTemplateFactory
;
import
com.zhaoonline.redis.serialize.SafeEncodeSerializer
;
import
com.zhaoonline.redis.template.OperationBuilder
;
public
class
DataValueRepository
<
V
>
{
...
...
@@ -17,10 +21,24 @@ public class DataValueRepository<V> {
@Autowired
public
DataValueRepository
(
RedisTemplateFactory
factory
){
this
(
factory
,
new
SafeEncodeSerializer
());
}
@Autowired
public
DataValueRepository
(
RedisTemplateFactory
factory
,
RedisSerializer
keySerializer
){
this
(
factory
,
keySerializer
,
new
GenericJackson2JsonRedisSerializer
());
}
@Autowired
public
DataValueRepository
(
RedisTemplateFactory
factory
,
RedisSerializer
keySerializer
,
RedisSerializer
valueSerializer
){
builder
=
new
OperationBuilder
<
V
>(
factory
);
redisTemplate
=
builder
.
template
();
redisTemplate
.
setKeySerializer
(
keySerializer
);
redisTemplate
.
setValueSerializer
(
valueSerializer
);
}
/**
* Method name: setIfAbsent <BR>
* Description: 若key不存在,成功set,返回true,若key存在,则返回false; <BR>
...
...
src/microservice-parent/microservice-redis/src/main/java/com/zhaoonline/redis/serialize/SafeEncodeSerializer.java
0 → 100644
View file @
cbc3b9d
package
com
.
zhaoonline
.
redis
.
serialize
;
import
org.springframework.data.redis.serializer.RedisSerializer
;
import
org.springframework.data.redis.serializer.SerializationException
;
import
redis.clients.util.SafeEncoder
;
public
class
SafeEncodeSerializer
implements
RedisSerializer
<
String
>{
@Override
public
byte
[]
serialize
(
String
t
)
throws
SerializationException
{
return
SafeEncoder
.
encode
(
t
);
}
@Override
public
String
deserialize
(
byte
[]
bytes
)
throws
SerializationException
{
if
(
bytes
==
null
||
bytes
.
length
==
0
){
return
null
;
}
return
SafeEncoder
.
encode
(
bytes
);
}
}
src/microservice-parent/microservice-redis/src/main/java/com/zhaoonline/redis/token/MultiSubmitToken.java
View file @
cbc3b9d
...
...
@@ -23,8 +23,11 @@ public class MultiSubmitToken {
* @return Long<BR>
*/
public
Long
getSubmmitToken
(
String
submitID
){
Long
submittime
=
token
.
getToken
(
submitID
);
return
submittime
;
Object
value
=
token
.
getToken
(
submitID
);
if
(
value
!=
null
){
return
Long
.
valueOf
(
String
.
valueOf
(
value
));
}
return
null
;
}
/**
...
...
src/microservice-parent/microservice-redis/src/main/java/com/zhaoonline/redis/token/Token.java
View file @
cbc3b9d
...
...
@@ -5,7 +5,10 @@ import java.util.concurrent.TimeUnit;
import
org.springframework.data.redis.core.BoundValueOperations
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer
;
import
org.springframework.data.redis.serializer.RedisSerializer
;
import
com.zhaoonline.redis.serialize.SafeEncodeSerializer
;
import
com.zhaoonline.redis.template.RedisTemplateFactory
;
/**
...
...
@@ -31,15 +34,22 @@ public class Token<T> {
this
(
factory
,
DEFAULT_EXPIRY_TIME_MILLIS
,
defaultTokenNameSpace
);
}
public
Token
(
RedisTemplateFactory
factory
,
int
expiryTimeMillis
){
this
(
factory
,
expiryTimeMillis
,
defaultTokenNameSpace
);
}
public
Token
(
RedisTemplateFactory
factory
,
int
expiryTimeMillis
,
String
tokenNameSpace
){
this
(
factory
,
expiryTimeMillis
,
defaultTokenNameSpace
,
new
SafeEncodeSerializer
(),
new
GenericJackson2JsonRedisSerializer
()
);
}
public
Token
(
RedisTemplateFactory
factory
,
int
expiryTimeMillis
,
RedisSerializer
keySerializer
,
RedisSerializer
valueSerializer
){
this
(
factory
,
expiryTimeMillis
,
defaultTokenNameSpace
,
new
SafeEncodeSerializer
(),
new
GenericJackson2JsonRedisSerializer
()
);
}
public
Token
(
RedisTemplateFactory
factory
,
int
expiryTimeMillis
,
String
tokenNameSpace
,
RedisSerializer
keySerializer
,
RedisSerializer
valueSerializer
){
redisTemplate
=
factory
.
createTemplate
();
redisTemplate
.
setKeySerializer
(
keySerializer
);
redisTemplate
.
setValueSerializer
(
valueSerializer
);
tokenExpiryInMillis
=
expiryTimeMillis
;
this
.
tokenNameSpace
=
tokenNameSpace
;
}
public
boolean
addToken
(
String
key
,
T
token
){
BoundValueOperations
<
String
,
T
>
valuOper
=
redisTemplate
.
boundValueOps
(
buildTokenKeyWithNameSpace
(
key
));
valuOper
.
expire
(
getTokenExpiryInMillis
(),
TimeUnit
.
MILLISECONDS
);
...
...
src/microservice-parent/microservice-redis/src/test/java/com/zhaoonline/redis/repository/TestDataValueRepository.java
View file @
cbc3b9d
...
...
@@ -8,6 +8,7 @@ import static org.hamcrest.MatcherAssert.*;
import
org.hamcrest.core.IsEqual
;
import
static
org
.
hamcrest
.
CoreMatchers
.*;
import
org.springframework.data.redis.connection.jedis.JedisConnectionFactory
;
import
org.springframework.util.Assert
;
import
com.zhaoonline.redis.template.RedisTemplateFactory
;
...
...
@@ -29,6 +30,7 @@ public class TestDataValueRepository {
User
user
=
new
User
();
user
.
setId
(
0
);
user
.
setName
(
"yyp"
);
userRepositroy
.
delete
(
"data:repo:test1"
);
userRepositroy
.
set
(
"data:repo:test1"
,
user
);
User
user2
=
userRepositroy
.
get
(
"data:repo:test1"
);
...
...
@@ -41,6 +43,19 @@ public class TestDataValueRepository {
}
@Test
public
void
testDelete
(){
DataValueRepository
<
User
>
userRepositroy
=
new
DataValueRepository
<
User
>(
factory
);
Object
value
=
userRepositroy
.
get
(
"alpaca:product:dict:product:T161100017"
);
Assert
.
notNull
(
value
);
userRepositroy
.
delete
(
"alpaca:product:dict:product:T161100017"
);
}
@After
public
void
after
(){
connectionFactory
.
destroy
();
...
...
@@ -51,6 +66,7 @@ public class TestDataValueRepository {
factory
.
setHostName
(
"192.168.0.188"
);
factory
.
setPort
(
6377
);
factory
.
setUsePool
(
true
);
factory
.
setDatabase
(
7
);
factory
.
afterPropertiesSet
();
return
factory
;
}
...
...
Please
register
or
login
to post a comment