Database Reference
In-Depth Information
Consumption Graph Model
This section examines a few techniques to capture and use patterns of consumption generated implicitly by a user
or users. For the purposes of your application, you will use the prepopulated set of products provided in the sample
graph. The code required for the console reinforces the standard persistence operations, but I will focus on the
operations that take advantage of this model type, including:
Capturing consumption
Filtering consumption for users
Filtering consumption for messaging
Product Entity
The Product entity is similar to the other entities that I have reviewed for this chapter, except that I have added an
indexType of FULLTEXT and specified the name for the index (Listing 11-46).
Listing 11-46. Product Entity
@NodeEntity
@TypeAlias("Product")
public class Product {
@GraphId
private Long nodeId;
@Indexed
private String productId;
private String title;
private String description;
private String tagstr;
@Indexed(indexType = IndexType.FULLTEXT, indexName = "productcontent")
private String content;
private String price;
@RelatedTo(type = GraphStoryConstants.HAS, direction =
Direction.OUTGOING, elementClass = Tag.class)
private Set<Tag> tags;
// getters and setters
}
 
Search WWH ::




Custom Search