Browse Source

jfinal 5.1.9 release ^_^

James 1 year ago
parent
commit
83ea556c67

+ 2 - 2
src/main/java/com/jfinal/plugin/activerecord/tx/Tx.java

@@ -46,7 +46,7 @@ public class Tx implements Interceptor {
 		return Tx.txFun;
 	}
 
-	public static Config getConfigWithTxConfig(Invocation inv) {
+	public static Config getConfigByTxConfig(Invocation inv) {
 		TxConfig txConfig = inv.getMethod().getAnnotation(TxConfig.class);
 		if (txConfig == null)
 			txConfig = inv.getTarget().getClass().getAnnotation(TxConfig.class);
@@ -65,7 +65,7 @@ public class Tx implements Interceptor {
 	}
 
 	public void intercept(Invocation inv) {
-		Config config = getConfigWithTxConfig(inv);
+		Config config = getConfigByTxConfig(inv);
 		if (config == null)
 			config = DbKit.getConfig();
 

+ 7 - 7
src/main/java/com/jfinal/plugin/activerecord/tx/TxByActionKeyRegex.java

@@ -31,25 +31,25 @@ import com.jfinal.plugin.activerecord.IAtom;
  * The regular expression match the controller key.
  */
 public class TxByActionKeyRegex implements Interceptor {
-	
+
 	private Pattern pattern;
-	
+
 	public TxByActionKeyRegex(String regex) {
 		this(regex, true);
 	}
-	
+
 	public TxByActionKeyRegex(String regex, boolean caseSensitive) {
 		if (StrKit.isBlank(regex))
 			throw new IllegalArgumentException("regex can not be blank.");
-		
+
 		pattern = caseSensitive ? Pattern.compile(regex) : Pattern.compile(regex, Pattern.CASE_INSENSITIVE);
 	}
-	
+
 	public void intercept(final Invocation inv) {
-		Config config = Tx.getConfigWithTxConfig(inv);
+		Config config = Tx.getConfigByTxConfig(inv);
 		if (config == null)
 			config = DbKit.getConfig();
-		
+
 		if (pattern.matcher(inv.getActionKey()).matches()) {
 			Db.use(config.getName()).tx(new IAtom() {
 				public boolean run() throws SQLException {

+ 6 - 6
src/main/java/com/jfinal/plugin/activerecord/tx/TxByActionKeys.java

@@ -30,22 +30,22 @@ import com.jfinal.plugin.activerecord.IAtom;
  * TxByActionKeys
  */
 public class TxByActionKeys implements Interceptor {
-	
+
 	private Set<String> actionKeySet = new HashSet<String>();
-	
+
 	public TxByActionKeys(String... actionKeys) {
 		if (actionKeys == null || actionKeys.length == 0)
 			throw new IllegalArgumentException("actionKeys can not be blank.");
-		
+
 		for (String actionKey : actionKeys)
 			actionKeySet.add(actionKey.trim());
 	}
-	
+
 	public void intercept(final Invocation inv) {
-		Config config = Tx.getConfigWithTxConfig(inv);
+		Config config = Tx.getConfigByTxConfig(inv);
 		if (config == null)
 			config = DbKit.getConfig();
-		
+
 		if (actionKeySet.contains(inv.getActionKey())) {
 			Db.use(config.getName()).tx(new IAtom() {
 				public boolean run() throws SQLException {

+ 7 - 7
src/main/java/com/jfinal/plugin/activerecord/tx/TxByMethodRegex.java

@@ -31,25 +31,25 @@ import com.jfinal.plugin.activerecord.IAtom;
  * The regular expression match the method name of the target.
  */
 public class TxByMethodRegex implements Interceptor {
-	
+
 	private Pattern pattern;
-	
+
 	public TxByMethodRegex(String regex) {
 		this(regex, true);
 	}
-	
+
 	public TxByMethodRegex(String regex, boolean caseSensitive) {
 		if (StrKit.isBlank(regex))
 			throw new IllegalArgumentException("regex can not be blank.");
-		
+
 		pattern = caseSensitive ? Pattern.compile(regex) : Pattern.compile(regex, Pattern.CASE_INSENSITIVE);
 	}
-	
+
 	public void intercept(final Invocation inv) {
-		Config config = Tx.getConfigWithTxConfig(inv);
+		Config config = Tx.getConfigByTxConfig(inv);
 		if (config == null)
 			config = DbKit.getConfig();
-		
+
 		if (pattern.matcher(inv.getMethodName()).matches()) {
 			Db.use(config.getName()).tx(new IAtom() {
 				public boolean run() throws SQLException {

+ 6 - 6
src/main/java/com/jfinal/plugin/activerecord/tx/TxByMethods.java

@@ -30,22 +30,22 @@ import com.jfinal.plugin.activerecord.IAtom;
  * TxByMethods
  */
 public class TxByMethods implements Interceptor {
-	
+
 	private Set<String> methodSet = new HashSet<String>();
-	
+
 	public TxByMethods(String... methods) {
 		if (methods == null || methods.length == 0)
 			throw new IllegalArgumentException("methods can not be null.");
-		
+
 		for (String method : methods)
 			methodSet.add(method.trim());
 	}
-	
+
 	public void intercept(final Invocation inv) {
-		Config config = Tx.getConfigWithTxConfig(inv);
+		Config config = Tx.getConfigByTxConfig(inv);
 		if (config == null)
 			config = DbKit.getConfig();
-		
+
 		if (methodSet.contains(inv.getMethodName())) {
 			Db.use(config.getName()).tx(new IAtom() {
 				public boolean run() throws SQLException {