예제 #1
0
  /**
   * Generates views based on annotations found in a persistent class. Typically @DocumentReferences
   * annotations.
   *
   * @param persistentType
   * @return a Map with generated views.
   */
  public Map<String, DesignDocument.View> generateViewsFromPersistentType(
      final Class<?> persistentType) {
    Assert.notNull(persistentType, "persistentType may not be null");
    final Map<String, DesignDocument.View> views = new HashMap<String, DesignDocument.View>();

    createDeclaredViews(views, persistentType);

    eachField(
        persistentType,
        new Predicate<Field>() {
          public boolean apply(Field input) {
            if (hasAnnotation(input, DocumentReferences.class)) {
              generateView(views, input);
            }
            return false;
          }
        });
    return views;
  }
예제 #2
0
 public StdDocumentChange(JsonNode node) {
   Assert.notNull(node, "node may not be null");
   this.node = node;
 }
 public void addComment(Comment c) {
   Assert.notNull(c, "Comment may not be null");
   Assert.hasText(c.getBlogPostId(), "Comment must have a blog post id");
   db.create(c);
 }
 public RevisionResponseHandler(ObjectMapper om) {
   Assert.notNull(om, "ObjectMapper cannot be null");
   objectMapper = om;
 }
예제 #5
0
파일: ViewQuery.java 프로젝트: rrva/Ektorp
 /**
  * Bring your own ObjectMapper. The mapper is used when serializing keys when building the query.
  *
  * @param om
  */
 public ViewQuery(ObjectMapper om) {
   Assert.notNull(om, "ObjectMapper may not be null");
   mapper = om;
 }