-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat:[uno-data]add query operator for tree select new feature
- Loading branch information
Showing
24 changed files
with
358 additions
and
90 deletions.
There are no files selected for viewing
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
59 changes: 59 additions & 0 deletions
59
.../uno-data-api/src/main/java/cc/allio/uno/data/orm/executor/BaseCommandExecutorLoader.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,59 @@ | ||
package cc.allio.uno.data.orm.executor; | ||
|
||
import cc.allio.uno.core.env.Envs; | ||
import cc.allio.uno.core.exception.Exceptions; | ||
import cc.allio.uno.data.orm.dsl.type.DBType; | ||
import cc.allio.uno.data.orm.executor.interceptor.Interceptor; | ||
import cc.allio.uno.data.orm.executor.options.ExecutorOptions; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* ingest general method for public base class on {@link CommandExecutorLoader} | ||
* <p> | ||
* for example determine {@link ExecutorOptions#isSystemDefault()} is true, if true then set db type as for default system env key | ||
* </p> | ||
* <p> | ||
* all relevant {@link CommandExecutorLoader} subclasses should be extended | ||
* </p> | ||
* | ||
* @author j.x | ||
* @date 2024/4/12 18:05 | ||
* @since 1.1.8 | ||
*/ | ||
public abstract class BaseCommandExecutorLoader<E extends AggregateCommandExecutor> implements CommandExecutorLoader<E> { | ||
|
||
@Override | ||
public E load(List<Interceptor> interceptors) { | ||
return onLoad(interceptors); | ||
} | ||
|
||
@Override | ||
public E load(ExecutorOptions executorOptions) { | ||
if (executorOptions == null) { | ||
throw Exceptions.unNull("ExecutorOptions"); | ||
} | ||
boolean systemDefault = executorOptions.isSystemDefault(); | ||
if (systemDefault) { | ||
DBType dbType = executorOptions.getDbType(); | ||
Envs.setProperty(DBType.DB_TYPE_CONFIG_KEY, dbType.getName()); | ||
} | ||
return onLoad(executorOptions); | ||
} | ||
|
||
/** | ||
* sub-class implementation, base on {@link Interceptor} create {@link AggregateCommandExecutor} sub-class-instance | ||
* | ||
* @param interceptors the list of interceptors | ||
* @return {@link AggregateCommandExecutor} instance | ||
*/ | ||
protected abstract E onLoad(List<Interceptor> interceptors); | ||
|
||
/** | ||
* sub-class implementation, base on {@link ExecutorOptions} create {@link AggregateCommandExecutor} sub-class-instance | ||
* | ||
* @param executorOptions the {@link ExecutorOptions} | ||
* @return {@link AggregateCommandExecutor} instance | ||
*/ | ||
protected abstract E onLoad(ExecutorOptions executorOptions); | ||
} |
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
Oops, something went wrong.