当前位置: 首页>>代码示例>>Java>>正文


Java InsertIntoDesc类代码示例

本文整理汇总了Java中com.espertech.esper.epl.spec.InsertIntoDesc的典型用法代码示例。如果您正苦于以下问题:Java InsertIntoDesc类的具体用法?Java InsertIntoDesc怎么用?Java InsertIntoDesc使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


InsertIntoDesc类属于com.espertech.esper.epl.spec包,在下文中一共展示了InsertIntoDesc类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: verifyInsertInto

import com.espertech.esper.epl.spec.InsertIntoDesc; //导入依赖的package包/类
private static void verifyInsertInto(InsertIntoDesc insertIntoDesc,
                                     List<SelectClauseExprCompiledSpec> selectionList)
        throws ExprValidationException {
    // Verify all column names are unique
    Set<String> names = new HashSet<String>();
    for (String element : insertIntoDesc.getColumnNames()) {
        if (names.contains(element)) {
            throw new ExprValidationException("Property name '" + element + "' appears more then once in insert-into clause");
        }
        names.add(element);
    }

    // Verify number of columns matches the select clause
    if ((!insertIntoDesc.getColumnNames().isEmpty()) &&
            (insertIntoDesc.getColumnNames().size() != selectionList.size())) {
        throw new ExprValidationException("Number of supplied values in the select or values clause does not match insert-into clause");
    }
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:19,代码来源:SelectExprProcessorHelper.java

示例2: verifyInsertInto

import com.espertech.esper.epl.spec.InsertIntoDesc; //导入依赖的package包/类
private static void verifyInsertInto(InsertIntoDesc insertIntoDesc,
                                     List<SelectClauseExprCompiledSpec> selectionList)
    throws ExprValidationException
{
    // Verify all column names are unique
    Set<String> names = new HashSet<String>();
    for (String element : insertIntoDesc.getColumnNames())
    {
        if (names.contains(element))
        {
            throw new ExprValidationException("Property name '" + element + "' appears more then once in insert-into clause");
        }
        names.add(element);
    }

    // Verify number of columns matches the select clause
    if ( (!insertIntoDesc.getColumnNames().isEmpty()) &&
         (insertIntoDesc.getColumnNames().size() != selectionList.size()) )
    {
        throw new ExprValidationException("Number of supplied values in the select clause does not match insert-into clause");
    }
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:23,代码来源:SelectExprProcessorHelper.java

示例3: setUp

import com.espertech.esper.epl.spec.InsertIntoDesc; //导入依赖的package包/类
public void setUp() throws Exception
{
    List<SelectClauseExprCompiledSpec> selectList = SupportSelectExprFactory.makeNoAggregateSelectList();
    EventAdapterService eventAdapterService = SupportEventAdapterService.getService();
    SupportValueAddEventService vaeService = new SupportValueAddEventService();
    SelectExprEventTypeRegistry selectExprEventTypeRegistry = new SelectExprEventTypeRegistry(new HashSet<String>());
    MethodResolutionService methodResolutionService = new MethodResolutionServiceImpl(new EngineImportServiceImpl(true, true, true), null);

    methodOne = new SelectExprProcessorHelper(Collections.<Integer>emptyList(), selectList, Collections.<SelectExprStreamDesc>emptyList(), null, false, new SupportStreamTypeSvc1Stream(), eventAdapterService, vaeService, selectExprEventTypeRegistry, methodResolutionService, null, null, new Configuration());

    InsertIntoDesc insertIntoDesc = new InsertIntoDesc(SelectClauseStreamSelectorEnum.ISTREAM_ONLY, "Hello");
    insertIntoDesc.add("a");
    insertIntoDesc.add("b");

    methodTwo = new SelectExprProcessorHelper(Collections.<Integer>emptyList(), selectList, Collections.<SelectExprStreamDesc>emptyList(), insertIntoDesc, false, new SupportStreamTypeSvc1Stream(), eventAdapterService, vaeService, selectExprEventTypeRegistry, methodResolutionService, null, null, new Configuration());
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:17,代码来源:TestSelectExprEvalProcessor.java

示例4: SelectExprProcessorHelper

import com.espertech.esper.epl.spec.InsertIntoDesc; //导入依赖的package包/类
public SelectExprProcessorHelper(Collection<Integer> assignedTypeNumberStack,
                                 List<SelectClauseExprCompiledSpec> selectionList,
                                 List<SelectExprStreamDesc> selectedStreams,
                                 InsertIntoDesc insertIntoDesc,
                                 EventType optionalInsertIntoOverrideType,
                                 boolean isUsingWildcard,
                                 StreamTypeService typeService,
                                 EventAdapterService eventAdapterService,
                                 ValueAddEventService valueAddEventService,
                                 SelectExprEventTypeRegistry selectExprEventTypeRegistry,
                                 EngineImportService engineImportService,
                                 int statementId,
                                 String statementName,
                                 Annotation[] annotations,
                                 ConfigurationInformation configuration,
                                 NamedWindowMgmtService namedWindowMgmtService,
                                 TableService tableService,
                                 GroupByRollupInfo groupByRollupInfo) throws ExprValidationException {
    this.assignedTypeNumberStack = assignedTypeNumberStack;
    this.selectionList = selectionList;
    this.selectedStreams = selectedStreams;
    this.insertIntoDesc = insertIntoDesc;
    this.optionalInsertIntoOverrideType = optionalInsertIntoOverrideType;
    this.eventAdapterService = eventAdapterService;
    this.isUsingWildcard = isUsingWildcard;
    this.typeService = typeService;
    this.valueAddEventService = valueAddEventService;
    this.selectExprEventTypeRegistry = selectExprEventTypeRegistry;
    this.engineImportService = engineImportService;
    this.statementId = statementId;
    this.statementName = statementName;
    this.annotations = annotations;
    this.configuration = configuration;
    this.namedWindowMgmtService = namedWindowMgmtService;
    this.tableService = tableService;
    this.groupByRollupInfo = groupByRollupInfo;
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:38,代码来源:SelectExprProcessorHelper.java

示例5: setUp

import com.espertech.esper.epl.spec.InsertIntoDesc; //导入依赖的package包/类
public void setUp() throws Exception {
    List<SelectClauseExprCompiledSpec> selectList = SupportSelectExprFactory.makeNoAggregateSelectList();
    EventAdapterService eventAdapterService = SupportEventAdapterService.getService();
    SupportValueAddEventService vaeService = new SupportValueAddEventService();
    SelectExprEventTypeRegistry selectExprEventTypeRegistry = new SelectExprEventTypeRegistry("abc", new StatementEventTypeRefImpl());
    EngineImportService engineImportService = SupportEngineImportServiceFactory.make();

    methodOne = new SelectExprProcessorHelper(Collections.<Integer>emptyList(), selectList, Collections.<SelectExprStreamDesc>emptyList(), null, null, false, new SupportStreamTypeSvc1Stream(), eventAdapterService, vaeService, selectExprEventTypeRegistry, engineImportService, 1, "stmtname", null, new Configuration(), null, new TableServiceImpl(), null);

    InsertIntoDesc insertIntoDesc = new InsertIntoDesc(SelectClauseStreamSelectorEnum.ISTREAM_ONLY, "Hello");
    insertIntoDesc.add("a");
    insertIntoDesc.add("b");

    methodTwo = new SelectExprProcessorHelper(Collections.<Integer>emptyList(), selectList, Collections.<SelectExprStreamDesc>emptyList(), insertIntoDesc, null, false, new SupportStreamTypeSvc1Stream(), eventAdapterService, vaeService, selectExprEventTypeRegistry, engineImportService, 1, "stmtname", null, new Configuration(), null, new TableServiceImpl(), null);
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:16,代码来源:TestSelectExprEvalProcessor.java

示例6: SelectExprProcessorHelper

import com.espertech.esper.epl.spec.InsertIntoDesc; //导入依赖的package包/类
/**
 * Ctor.
 * @param selectionList - list of select-clause items
 * @param insertIntoDesc - descriptor for insert-into clause contains column names overriding select clause names
 * @param isUsingWildcard - true if the wildcard (*) appears in the select clause
 * @param typeService -service for information about streams
 * @param eventAdapterService - service for generating events and handling event types
 * @param valueAddEventService - service that handles update events
 * @param selectExprEventTypeRegistry - service for statement to type registry
 * @param methodResolutionService - for resolving methods
 * @throws com.espertech.esper.epl.expression.ExprValidationException thrown if any of the expressions don't validate
 */
public SelectExprProcessorHelper(Collection<Integer> assignedTypeNumberStack,
                               List<SelectClauseExprCompiledSpec> selectionList,
                               List<SelectExprStreamDesc> selectedStreams,
                               InsertIntoDesc insertIntoDesc,
                               boolean isUsingWildcard,
                               StreamTypeService typeService,
                               EventAdapterService eventAdapterService,
                               ValueAddEventService valueAddEventService,
                               SelectExprEventTypeRegistry selectExprEventTypeRegistry,
                               MethodResolutionService methodResolutionService,
                               String statementId,
                               Annotation[] annotations,
                               ConfigurationInformation configuration) throws ExprValidationException
{
    this.assignedTypeNumberStack = assignedTypeNumberStack;
    this.selectionList = selectionList;
    this.selectedStreams = selectedStreams;
    this.insertIntoDesc = insertIntoDesc;
    this.eventAdapterService = eventAdapterService;
    this.isUsingWildcard = isUsingWildcard;
    this.typeService = typeService;
    this.valueAddEventService = valueAddEventService;
    this.selectExprEventTypeRegistry = selectExprEventTypeRegistry;
    this.methodResolutionService = methodResolutionService;
    this.statementId = statementId;
    this.annotations = annotations;
    this.configuration = configuration;
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:41,代码来源:SelectExprProcessorHelper.java

示例7: getInsertUnderlyingNonJoin

import com.espertech.esper.epl.spec.InsertIntoDesc; //导入依赖的package包/类
public static SelectExprProcessorForge getInsertUnderlyingNonJoin(EventAdapterService eventAdapterService,
                                                                  EventType eventType,
                                                                  boolean isUsingWildcard,
                                                                  StreamTypeService typeService,
                                                                  ExprForge[] forges,
                                                                  String[] columnNames,
                                                                  Object[] expressionReturnTypes,
                                                                  EngineImportService engineImportService,
                                                                  InsertIntoDesc insertIntoDesc,
                                                                  String[] columnNamesAsProvided,
                                                                  boolean allowNestableTargetFragmentTypes,
                                                                  String statementName)
        throws ExprValidationException {
    // handle single-column coercion to underlying, i.e. "insert into MapDefinedEvent select doSomethingReturnMap() from MyEvent"
    if (expressionReturnTypes.length == 1 &&
            expressionReturnTypes[0] instanceof Class &&
            (eventType instanceof BaseNestableEventType || eventType instanceof AvroSchemaEventType) &&
            JavaClassHelper.isSubclassOrImplementsInterface((Class) expressionReturnTypes[0], eventType.getUnderlyingType()) &&
            insertIntoDesc.getColumnNames().isEmpty() &&
            columnNamesAsProvided[0] == null) {

        if (eventType instanceof MapEventType) {
            return new SelectExprInsertNativeExpressionCoerceMap(eventType, forges[0], eventAdapterService);
        } else if (eventType instanceof ObjectArrayEventType) {
            return new SelectExprInsertNativeExpressionCoerceObjectArray(eventType, forges[0], eventAdapterService);
        } else if (eventType instanceof AvroSchemaEventType) {
            return new SelectExprInsertNativeExpressionCoerceAvro(eventType, forges[0], eventAdapterService);
        } else {
            throw new IllegalStateException("Unrecognied event type " + eventType);
        }
    }

    // handle special case where the target type has no properties and there is a single "null" value selected
    if (eventType.getPropertyDescriptors().length == 0 &&
            columnNames.length == 1 &&
            columnNames[0].equals("null") &&
            expressionReturnTypes[0] == null &&
            !isUsingWildcard) {

        EventBeanManufacturer eventManufacturer;
        try {
            eventManufacturer = eventAdapterService.getManufacturer(eventType, new WriteablePropertyDescriptor[0], engineImportService, true);
        } catch (EventBeanManufactureException e) {
            throw new ExprValidationException(e.getMessage(), e);
        }
        return new SelectExprInsertNativeNoEval(eventType, eventManufacturer);
    }

    // handle writing to defined columns
    Set<WriteablePropertyDescriptor> writableProps = eventAdapterService.getWriteableProperties(eventType, false);
    boolean isEligible = checkEligible(eventType, writableProps, allowNestableTargetFragmentTypes);
    if (!isEligible) {
        return null;
    }

    try {
        return initializeSetterManufactor(eventType, writableProps, isUsingWildcard, typeService, forges, columnNames, expressionReturnTypes, engineImportService, eventAdapterService, statementName);
    } catch (ExprValidationException ex) {
        if (!(eventType instanceof BeanEventType)) {
            throw ex;
        }
        // Try constructor injection
        try {
            return initializeCtorInjection((BeanEventType) eventType, forges, expressionReturnTypes, engineImportService, eventAdapterService, statementName);
        } catch (ExprValidationException ctorEx) {
            if (writableProps.isEmpty()) {
                throw ctorEx;
            }
            throw ex;
        }
    }
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:73,代码来源:SelectExprInsertEventBeanFactory.java

示例8: getInsertUnderlyingNonJoin

import com.espertech.esper.epl.spec.InsertIntoDesc; //导入依赖的package包/类
public static SelectExprProcessor getInsertUnderlyingNonJoin(EventAdapterService eventAdapterService, EventType eventType,
                        boolean isUsingWildcard, StreamTypeService typeService, ExprEvaluator[] expressionNodes, String[] columnNames, Object[] expressionReturnTypes, EngineImportService engineImportService,
                        InsertIntoDesc insertIntoDesc, String[] columnNamesAsProvided)
        throws ExprValidationException
{
    // handle single-column coercion to underlying, i.e. "insert into MapDefinedEvent select doSomethingReturnMap() from MyEvent"
    if (expressionReturnTypes.length == 1 &&
            expressionReturnTypes[0] instanceof Class &&
            eventType instanceof BaseNestableEventType &&
            JavaClassHelper.isSubclassOrImplementsInterface((Class) expressionReturnTypes[0], eventType.getUnderlyingType()) &&
            insertIntoDesc.getColumnNames().isEmpty() &&
            columnNamesAsProvided[0] == null) {

        if (eventType instanceof MapEventType) {
            return new SelectExprInsertNativeExpressionCoerceMap(eventType, expressionNodes[0], eventAdapterService);
        }
        return new SelectExprInsertNativeExpressionCoerceObjectArray(eventType, expressionNodes[0], eventAdapterService);
    }

    // handle writing to defined columns
    Set<WriteablePropertyDescriptor> writableProps = eventAdapterService.getWriteableProperties(eventType);
    boolean isEligible = checkEligible(eventType, writableProps);
    if (!isEligible) {
        return null;
    }

    try {
        return initializeSetterManufactor(eventType, writableProps, isUsingWildcard, typeService, expressionNodes, columnNames, expressionReturnTypes, engineImportService, eventAdapterService);
    }
    catch (ExprValidationException ex) {
        if (!(eventType instanceof BeanEventType)) {
            throw ex;
        }
        // Try constructor injection
        try {
            return initializeCtorInjection(eventType, expressionNodes, typeService, expressionReturnTypes, engineImportService, eventAdapterService);
        }
        catch (ExprValidationException ctorEx) {
            if (writableProps.isEmpty()) {
                throw ctorEx;
            }
            throw ex;
        }
    }
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:46,代码来源:SelectExprInsertEventBeanFactory.java


注:本文中的com.espertech.esper.epl.spec.InsertIntoDesc类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。