简体   繁体   English

使用Siena的非规范化数据建模

[英]Denormalized data modeling with Siena

I am trying to create a simple app on GAE/J. 我正在尝试在GAE / J上创建一个简单的应用程序。 The data model consists of a list of notes , each with a few tags . 数据模型由一个notes列表组成,每个notes带有一些tags

In the relational world, this would be a many-to-many - since each note can have several tags , and every tag can "belong" to several notes . 在关系世界中,这将是多对多的-因为每个note可以有多个tags ,并且每个tag都可以“属于”多个notes However, this doesn't fit GAE datastore environment very well. 但是,这不太适合GAE数据存储环境。 So, I'm considering saving with each note , its list of tags as well. 因此,我正在考虑同时保存每个note及其tags列表。 If indexed properly, searching by tag should be quick too. 如果索引正确,按标签搜索也应该很快。

My question: How to model this using Siena? 我的问题:如何使用Siena对此建模? Documentation is sparse and I saw the examples, but got confused. 文档很少,我看到了示例,但感到困惑。

Siena doc is sparsed as I don't have time to work on it anymore... I'm busy on other projects and if anyone wants to contribute and maintain Siena, he/she's welcome ;) 锡耶纳(Siena)文档很稀疏,因为我没有时间再处理它了...我正忙于其他项目,如果有人想贡献和维护锡耶纳(Siena),欢迎他;)

Considering your question, yes you should use a simple List (aka properties list) which is managed by Siena and works in GAE. 考虑到您的问题,是的,您应该使用一个简单的列表(也称为属性列表),该列表由Siena管理并在GAE中工作。

Add a field such as : (no annotation) 添加一个字段,例如:(无注释)

List<String> tags

It should work! 它应该工作!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM