crane4j
crane4j copied to clipboard
数据源容器支持“先从 A 找,找不到再从 B 找……”的场景
在实际使用中,经常会面临 “先从 A 找,找不到再从 B 找……” 这类场景,希望从数据源容器的层面基于支持,比如:
@Assemble(
container = "user",
candidateContainers = { "tenant", “organization” }, // 指定候补容器
props = "name"
)
private Integer id;
在上述示例中,将先根据 ID 从 user
容器中查询,如果查不到再依次从 tenant
与 organization
容器中查询。
由于目前 AssembleOperationHandler
与 AbstractBeanOperationExecutor
都是以容器为单位执行操作的,因此需要考虑如何兼容这部分逻辑。