All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.schoolwow.util.domain.query.instance.QueryInstance Maven / Gradle / Ivy

There is a newer version: 1.0.2
Show newest version
package cn.schoolwow.util.domain.query.instance;

import cn.schoolwow.quickflow.QuickFlow;
import cn.schoolwow.quickflow.QuickFlowBuilder;
import cn.schoolwow.util.module.query.instance.domain.InstanceQueryOption;
import cn.schoolwow.util.module.query.instance.service.SetInstanceFieldValueFlow;

public class QueryInstance {
    private InstanceQueryOption instanceQueryOption = new InstanceQueryOption();

    private static QuickFlow quickFlow = QuickFlowBuilder.newInstance();

    /**创建实例查询*/
    public static QueryInstance newQuery(Object instance){
        QueryInstance instanceQuery = new QueryInstance();
        instanceQuery.instanceQueryOption.instance = instance;
        return instanceQuery;
    }

    public QueryInstance() {
        quickFlow.putContextThreadLocalData("instanceQueryOption", instanceQueryOption);
    }

    public QueryInstance setFieldValue(String fieldName, Object fieldValue){
        quickFlow.startFlow(new SetInstanceFieldValueFlow())
                .putCurrentCompositeFlowData("fieldName", fieldName)
                .putCurrentCompositeFlowData("fieldValue", fieldValue)
                .execute();
        return this;
    }

    public QueryInstanceResponse execute(){
        return new QueryInstanceResponse(quickFlow);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy