我有以下课程
library(XML)
query <- "http://overpass-api.de/api/interpreter?data=[out:xml];way[amenity=fire_station](45.7073666,4.7718134,45.8082628,4.8983774);out geom;"
resp <- xmlParse(query)
id <- xpathSApply(resp,"//way", xmlAttrs)
xy <- lapply(id, function(x) {
t(xpathSApply(resp_xml, paste0("//way[@id=\"", x, "\"]/nd"), xmlAttrs)) # The attribute is "nd"
})
# Input
# <way id="85040904">
# <bounds minlat="45.7787373" minlon="4.8776611" maxlat="45.7791660" maxlon="4.8783108"/>
# <nd ref="986810237" lat="45.7791513" lon="4.8781562"/>
# <nd ref="986813467" lat="45.7790175" lon="4.8779384"/>
# ...
# Output
# $id
# ref lat lon
# [1,] "986810237" "45.7791513" "4.8781562"
# [2,] "986813467" "45.7790175" "4.8779384"
# ...
审计表看起来像这样
public class Product
{
public virtual int Id { get; set; }
public virtual double Price { get; set; }
public virtual string Description { get; set; }
}
我的查询看起来像这样
CREATE TABLE Product_AUD (
Id integer not null,
REV integer not null,
Price float,
Price_MOD bit,
Description varchar(255),
Description_MOD bit,
REVTYPE tinyint not null,
primary key (id, REV)
);
到目前为止,这有效并返回var revisionEntityInfos =
Session.Auditer().CreateQuery()
.ForHistoryOf<Product, DefaultRevisionEntity>()
.Add(AuditEntity.Id().Eq(ProductId))
.Add(AuditEntity.Or(AuditEntity.Property("Description").HasChanged(),
AuditEntity.Property("Price").HasChanged()))
.Results();
。
我得到了属性IEnumerable<Product, DefaultRevisionEntity>
,属性Description
或两者都已更改的所有修订版。包含Price
和RevisionId
的信息。
但是我也希望看到每个版本的更改属性,因为我想将其显示给用户。所以基本上我想在结果中使用RevisionDate
标志。这可能吗?