mybatis-jpa-extra

This commit is contained in:
MaxKey
2022-04-14 22:09:27 +08:00
parent f749f4c845
commit 5e4923d6b4
12 changed files with 113 additions and 57 deletions

View File

@@ -19,7 +19,7 @@ package org.apache.mybatis.jpa.test;
import java.text.SimpleDateFormat;
import java.util.Date;
import org.apache.mybatis.jpa.util.WebContext;
import org.apache.mybatis.jpa.util.JpaWebContext;
import org.junit.Before;
import org.junit.Test;
import org.maxkey.entity.Accounts;
@@ -38,7 +38,7 @@ public class AccountsServiceTest {
public static AccountsService service;
public AccountsService getservice() {
service=(AccountsService)WebContext.getBean("accountsService");
service=(AccountsService)JpaWebContext.getBean("accountsService");
return service;
}
@@ -93,7 +93,7 @@ public class AccountsServiceTest {
_logger.info("Application dir "+System.getProperty("user.dir"));
context = new ClassPathXmlApplicationContext(new String[] {"spring/applicationContext.xml"});
WebContext.applicationContext=context;
JpaWebContext.applicationContext=context;
getservice();
System.out.println("init ...");

View File

@@ -19,7 +19,7 @@ package org.apache.mybatis.jpa.test;
import java.text.SimpleDateFormat;
import java.util.Date;
import org.apache.mybatis.jpa.util.WebContext;
import org.apache.mybatis.jpa.util.JpaWebContext;
import org.junit.Before;
import org.junit.Test;
import org.maxkey.entity.apps.Apps;
@@ -38,7 +38,7 @@ public class AppsServiceTest {
public static AppsService service;
public AppsService getservice() {
service=(AppsService)WebContext.getBean("appsService");
service=(AppsService)JpaWebContext.getBean("appsService");
return service;
}
@@ -81,7 +81,7 @@ public class AppsServiceTest {
_logger.info("Application dir "+System.getProperty("user.dir"));
context = new ClassPathXmlApplicationContext(new String[] {"spring/applicationContext.xml"});
WebContext.applicationContext=context;
JpaWebContext.applicationContext=context;
getservice();
System.out.println("init ...");

View File

@@ -22,7 +22,7 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.apache.mybatis.jpa.util.WebContext;
import org.apache.mybatis.jpa.util.JpaWebContext;
import org.junit.Before;
import org.junit.Test;
import org.maxkey.entity.apps.AppsFormBasedDetails;
@@ -41,7 +41,7 @@ public class FormBasedDetailsServiceTest {
public static AppsFormBasedDetailsService service;
public AppsFormBasedDetailsService getservice() {
service=(AppsFormBasedDetailsService)WebContext.getBean("appsFormBasedDetailsService");
service=(AppsFormBasedDetailsService)JpaWebContext.getBean("appsFormBasedDetailsService");
return service;
}
@@ -142,7 +142,7 @@ public class FormBasedDetailsServiceTest {
_logger.info("Application dir "+System.getProperty("user.dir"));
context = new ClassPathXmlApplicationContext(new String[] {"spring/applicationContext.xml"});
WebContext.applicationContext=context;
JpaWebContext.applicationContext=context;
getservice();
System.out.println("init ...");