我们有一个帖子表
Post
PostID, Title, Description, isDeleted, ModifiedDateTime
可以为每个帖子分配或删除多个标签
Tag
TagID, PostID, TagValue
如果在删除标签或添加新标签时进行增量导入,如何编写子实体标签 邮寄文件应该更新吗?
这是我的mapping.xml的一部分
<document name="CollabDocument">
<entity name="post" transformer="RegexTransformer" dataSource="db" pk="PostID"
query="SELECT PostID, Title, Description, CreatedDate FROM Post where isDeleted =
0"
deltaImportQuery="select PostID, Title, Description,CreatedDate FROM Post where
PostID='${dataimporter.delta.PostID}'"
deltaQuery="select PostID from Post where ModifiedDate >
${dataimporter.last_index_time}' and isDeleted = 0"
deletedPkQuery="select PostID from Post where isDeleted = 1">
<field column="PostID" name="id" />
<field column="PostID" name="PostID" />
<field column="Title" name="Title" />
<field column="Description" name="Description" />
<field column="CreatedDate" name="CreatedDate"/>
<entity name="Triples" dataSource="db" transformer="RegexTransformer"
query="select group_concat(ts.value separator '|') AS TagValues from
tags ts where ts.postid = ${post.PostID} group by ts.PostId">
<field name="TagValues" column="TagValues" />
</entity>