-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
jiangwenping
committed
Mar 29, 2017
1 parent
434dc60
commit 655089f
Showing
9 changed files
with
123 additions
and
13 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
src/main/java/com/snowcattle/game/db/cache/redis/AsyncCacheKey.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package com.snowcattle.game.db.cache.redis; | ||
|
||
/** | ||
* Created by jiangwenping on 17/3/29. | ||
* 异步存储的时候异步key | ||
*/ | ||
public interface AsyncCacheKey { | ||
public String getAsyncCacheKey(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 75 additions & 0 deletions
75
src/test/java/com/snowcattle/game/db/service/jdbc/test/JdbcAsyncCacheTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
package com.snowcattle.game.db.service.jdbc.test; | ||
|
||
import com.snowcattle.game.db.service.jdbc.entity.Order; | ||
import com.snowcattle.game.db.service.jdbc.service.impl.OrderService; | ||
import com.snowcattle.game.db.service.proxy.EntityAysncServiceProxyFactory; | ||
import org.springframework.context.support.ClassPathXmlApplicationContext; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* Created by jiangwenping on 17/3/29. | ||
*/ | ||
public class JdbcAsyncCacheTest { | ||
public static long userId = 99999; | ||
|
||
public static void main(String[] args) throws Exception { | ||
ClassPathXmlApplicationContext classPathXmlApplicationContext = new ClassPathXmlApplicationContext(new String[]{"bean/db_applicationContext.xml"}); | ||
OrderService orderService = getOrderProxyService(classPathXmlApplicationContext); | ||
// insertTest(classPathXmlApplicationContext, orderService); | ||
// insertBatchTest(classPathXmlApplicationContext, orderService); | ||
// Order order = getTest(classPathXmlApplicationContext, orderService); | ||
// List<Order> orderList = getOrderList(classPathXmlApplicationContext, orderService); | ||
// updateTest(classPathXmlApplicationContext, orderService, order); | ||
// updateBatchTest(classPathXmlApplicationContext, orderService, orderList); | ||
// deleteTest(classPathXmlApplicationContext, orderService, order); | ||
// deleteBatchTest(classPathXmlApplicationContext, orderService, orderList); | ||
// getListTest(classPathXmlApplicationContext, orderService); | ||
|
||
} | ||
|
||
|
||
public static void deleteBatchTest(ClassPathXmlApplicationContext classPathXmlApplicationContext, OrderService orderService, List<Order> orderList) throws Exception { | ||
JdbcTest.deleteBatchTest(classPathXmlApplicationContext, orderService, orderList); | ||
} | ||
|
||
public static void updateBatchTest(ClassPathXmlApplicationContext classPathXmlApplicationContext, OrderService orderService, List<Order> orderList) throws Exception { | ||
JdbcTest.updateBatchTest(classPathXmlApplicationContext, orderService, orderList); | ||
} | ||
|
||
public static void insertBatchTest(ClassPathXmlApplicationContext classPathXmlApplicationContext, OrderService orderService) throws Exception { | ||
JdbcTest.insertBatchTest(classPathXmlApplicationContext, orderService); | ||
} | ||
|
||
public static List<Order> getOrderList(ClassPathXmlApplicationContext classPathXmlApplicationContext, OrderService orderService) throws Exception { | ||
return JdbcTest.getOrderList(classPathXmlApplicationContext, orderService); | ||
} | ||
|
||
public static void insertTest(ClassPathXmlApplicationContext classPathXmlApplicationContext, OrderService orderService) { | ||
JdbcTest.insertTest(classPathXmlApplicationContext, orderService); | ||
} | ||
|
||
public static Order getTest(ClassPathXmlApplicationContext classPathXmlApplicationContext, OrderService orderService) { | ||
return JdbcTest.getTest(classPathXmlApplicationContext, orderService); | ||
} | ||
|
||
public static void getListTest(ClassPathXmlApplicationContext classPathXmlApplicationContext, OrderService orderService) { | ||
JdbcTest.getListTest(classPathXmlApplicationContext, orderService); | ||
} | ||
|
||
|
||
public static void updateTest(ClassPathXmlApplicationContext classPathXmlApplicationContext, OrderService orderService, Order order) throws Exception { | ||
JdbcTest.updateTest(classPathXmlApplicationContext, orderService, order); | ||
} | ||
|
||
public static void deleteTest(ClassPathXmlApplicationContext classPathXmlApplicationContext, OrderService orderService, Order order) throws Exception { | ||
JdbcTest.deleteTest(classPathXmlApplicationContext, orderService, order); | ||
} | ||
|
||
public static OrderService getOrderProxyService(ClassPathXmlApplicationContext classPathXmlApplicationContext) throws Exception { | ||
OrderService orderService = (OrderService) classPathXmlApplicationContext.getBean("orderService"); | ||
EntityAysncServiceProxyFactory entityAysncServiceProxyFactory = (EntityAysncServiceProxyFactory) classPathXmlApplicationContext.getBean("entityAysncServiceProxyFactory"); | ||
orderService = entityAysncServiceProxyFactory.createProxyService(orderService); | ||
return orderService; | ||
} | ||
} |