protected override Doc DoPopulateDoc(MySqlCrudQueryExecutionContext context, Type tDoc, Schema schema, Schema.FieldDef[] toLoad, MySqlDataReader reader) { var verState = VersionInfo.MapCanonicalState(reader.AsStringField("VERSION_STATE")); var gop = context.GetState <GdidOrPath>(); var result = new TreeNodeInfo(); result.Forest = gop.Id.System; result.Tree = gop.Id.Type; result.Gdid = reader.AsGdidField("GDID"); result.G_Parent = reader.AsGdidField("G_PARENT"); result.PathSegment = reader.AsStringField("PATH_SEGMENT"); result.FullPath = "[n/a for version specific node]"; result.StartUtc = reader.AsDateTimeField("START_UTC").Value; result.Properties = Constraints.MapToConfigRoot(reader.AsStringField("PROPERTIES")); result.LevelConfig = Constraints.MapToConfigRoot(reader.AsStringField("CONFIG")); result.DataVersion = new VersionInfo { G_Version = reader.AsGdidField("G_VERSION"), State = verState, Actor = reader.AsEntityIdField("VERSION_ACTOR").Value, Origin = reader.AsAtomField("VERSION_ORIGIN").Value, Utc = reader.AsDateTimeField("VERSION_UTC").Value }; return(result); }
protected override Doc DoPopulateDoc(MySqlCrudQueryExecutionContext context, Type tDoc, Schema schema, Schema.FieldDef[] toLoad, MySqlDataReader reader) { var verState = VersionInfo.MapCanonicalState(reader.AsStringField("VERSION_STATE")); if (!VersionInfo.IsExistingStateOf(verState)) { return(null); //deleted, skip this doc } var tree = context.GetState <TreePtr>(); var result = new TreeNodeInfo(); result.Forest = tree.IdForest; result.Tree = tree.IdTree; result.Gdid = reader.AsGdidField("GDID"); result.G_Parent = reader.AsGdidField("G_PARENT"); result.PathSegment = reader.AsStringField("PATH_SEGMENT"); result.FullPath = null;//calculated by logic result.StartUtc = reader.AsDateTimeField("START_UTC").Value; result.Properties = Constraints.MapToConfigRoot(reader.AsStringField("PROPERTIES")); result.LevelConfig = Constraints.MapToConfigRoot(reader.AsStringField("CONFIG")); result.DataVersion = new VersionInfo { G_Version = reader.AsGdidField("G_VERSION"), State = verState, Actor = reader.AsEntityIdField("VERSION_ACTOR").Value, Origin = reader.AsAtomField("VERSION_ORIGIN").Value, Utc = reader.AsDateTimeField("VERSION_UTC").Value }; return(result); }
protected override Doc DoPopulateDoc(MySqlCrudQueryExecutionContext context, Type tDoc, Schema schema, Schema.FieldDef[] toLoad, MySqlDataReader reader) { return(new VersionInfo() { G_Version = reader.AsGdidField("GDID"), State = VersionInfo.MapCanonicalState(reader.AsStringField("VERSION_STATE")), Actor = reader.AsEntityIdField("VERSION_ACTOR").Value, Origin = reader.AsAtomField("VERSION_ORIGIN").Value, Utc = reader.AsDateTimeField("VERSION_UTC").Value }); }