/// <summary> /// Creates a query view from the service provider. /// </summary> /// <typeparam name="T"></typeparam> /// <param name="serviceProvider">The service provider.</param> /// <returns></returns> public static EsperQuery <T> From <T>(this EPServiceProvider serviceProvider) { var selectClause = SelectClause.Create(); selectClause.AddWildcard(); var objectModel = new EPStatementObjectModel(); objectModel.SelectClause = selectClause; objectModel.FromClause = FromClause.Create(); objectModel.FromClause.Add(FilterStream.Create(typeof(T).FullName)); objectModel.MakeIterableUnbound(); return(new EsperQuery <T>(serviceProvider, objectModel)); }
/// <summary> /// Creates a query view from the service provider. /// </summary> /// <typeparam name="T"></typeparam> /// <param name="serviceProvider">The service provider.</param> /// <param name="streamNames">The stream names.</param> /// <returns></returns> public static EsperQuery <T> From <T>(this EPServiceProvider serviceProvider, params string[] streamNames) { var selectClause = SelectClause.Create(); selectClause.AddWildcard(); var objectModel = new EPStatementObjectModel(); objectModel.SelectClause = selectClause; objectModel.FromClause = FromClause.Create(); objectModel.MakeIterableUnbound(); for (int ii = 0; ii < streamNames.Length; ii++) { objectModel.FromClause.Add(FilterStream.Create(streamNames[ii])); } return(new EsperQuery <T>(serviceProvider, objectModel)); }
/// <summary> /// Creates a query view from the service provider. /// </summary> /// <param name="serviceProvider">The service provider.</param> /// <param name="typeList">The type list.</param> /// <returns></returns> public static EsperQuery <T> From <T>(this EPServiceProvider serviceProvider, params Type[] typeList) { var selectClause = SelectClause.Create(); selectClause.AddWildcard(); var objectModel = new EPStatementObjectModel(); objectModel.SelectClause = selectClause; objectModel.FromClause = FromClause.Create(); objectModel.MakeIterableUnbound(); for (int ii = 0; ii < typeList.Length; ii++) { var type = typeList[ii]; var streamName = String.Format("s{0}", ii); objectModel.FromClause.Add(FilterStream.Create(type.FullName, streamName)); } return(new EsperQuery <T>(serviceProvider, objectModel)); }