Package com.google.appengine.api.datastore

Examples of com.google.appengine.api.datastore.Text


    this.readOnly = readOnly;
  }

  public void setTopicContent(String content) {
    // renderHtml(content);
    this.content = new Text(content);
  }
View Full Code Here


    if (user != null && user.getUserId() != null) {
      this.authorId = user.getUserId();
    }
    this.authorDisplay = authorDisplay;
    this.editComment = editComment;
    this.versionContent = new Text(versionContent);
    this.charactersChanged = charactersChanged;
  }
View Full Code Here

  /**
   *
   */
  public void setVersionContent(String versionContent) {
    this.versionContent = new Text(versionContent);
  }
View Full Code Here

    // ce.setLayoutManager(new OneElementOnLineLayouter());

    final ViewerTextElement tm = new ViewerTextElement() {
      protected void setValue(IBinding binding, Object value) {
        if (value instanceof Text) {
          Text c = (Text) value;
          super.setValue(binding, c.getValue());
        }
      }

      protected void doCommit(final IBinding binding2) {
        commitToBinding(new Text(getText()));
      }

    };
    tm.setWrapText(false);
    // ce.add(tm);
View Full Code Here

        return m;
      }
      return value;
    }
    if (value instanceof Text) {
      Text t = (Text) value;
      String value2 = t.getValue();

      if (value2.length() > 1000 && !isForStoring) {
        return new Text(value2.substring(0, 100) + "...");
      }
    }
    if (value instanceof Blob) {
      if (!isForStoring) {
        return new Blob(bytes);
View Full Code Here

    @Test
    public void asListOfCipherText() throws Exception {
        Hoge hoge1 = new Hoge();
        Hoge hoge2 = new Hoge();
        Hoge hoge3 = new Hoge();
        hoge1.setMyCipherText(new Text("1102"));
        hoge2.setMyCipherText(new Text("1103"));
        hoge3.setMyCipherText(new Text("1104"));
        DatastoreUtil.put(ds, null, DatastoreUtil.modelToEntity(ds, hoge1));
        DatastoreUtil.put(ds, null, DatastoreUtil.modelToEntity(ds, hoge2));
        DatastoreUtil.put(ds, null, DatastoreUtil.modelToEntity(ds, hoge3));
        List<Hoge> list =
            new ModelQuery<Hoge>(ds, meta).sortInMemory(meta.key.asc).asList();
View Full Code Here

    public void asListAndFilterInMemoryByEqualCriterionOfCipherText()
            throws Exception {
        Hoge hoge1 = new Hoge();
        Hoge hoge2 = new Hoge();
        Hoge hoge3 = new Hoge();
        hoge1.setMyCipherText(new Text("1102"));
        hoge2.setMyCipherText(new Text("1103"));
        hoge3.setMyCipherText(new Text("1104"));
        DatastoreUtil.put(ds, null, DatastoreUtil.modelToEntity(ds, hoge1));
        DatastoreUtil.put(ds, null, DatastoreUtil.modelToEntity(ds, hoge2));
        DatastoreUtil.put(ds, null, DatastoreUtil.modelToEntity(ds, hoge3));
        List<Hoge> list =
            new ModelQuery<Hoge>(ds, meta)
                .filterInMemory(new EqualCriterion(meta.myCipherText, "1102"))
                .filterInMemory(
                    new EqualCriterion(meta.myCipherText, new Text("1102")))
                .filterInMemory(
                    new InMemoryEqualCriterion(meta.myCipherText, "1102"))
                .filterInMemory(
                    new InMemoryEqualCriterion(meta.myCipherText, new Text(
                        "1102")))
                .sortInMemory(meta.key.asc)
                .asList();
        assertThat(list.size(), is(1));
        assertThat(list.get(0).getMyCipherText().getValue(), is("1102"));
View Full Code Here

    public void asListAndFilterInMemoryByGreaterThanCriterionOfCipherText()
            throws Exception {
        Hoge hoge1 = new Hoge();
        Hoge hoge2 = new Hoge();
        Hoge hoge3 = new Hoge();
        hoge1.setMyCipherText(new Text("1102"));
        hoge2.setMyCipherText(new Text("1103"));
        hoge3.setMyCipherText(new Text("1104"));
        DatastoreUtil.put(ds, null, DatastoreUtil.modelToEntity(ds, hoge1));
        DatastoreUtil.put(ds, null, DatastoreUtil.modelToEntity(ds, hoge2));
        DatastoreUtil.put(ds, null, DatastoreUtil.modelToEntity(ds, hoge3));
        List<Hoge> list =
            new ModelQuery<Hoge>(ds, meta)
                .filterInMemory(
                    new GreaterThanCriterion(meta.myCipherText, "1103"))
                .filterInMemory(
                    new GreaterThanCriterion(
                        meta.myCipherText,
                        new Text("1103")))
                .filterInMemory(
                    new InMemoryGreaterThanCriterion(meta.myCipherText, "1103"))
                .filterInMemory(
                    new InMemoryGreaterThanCriterion(
                        meta.myCipherText,
                        new Text("1103")))
                .sortInMemory(meta.key.asc)
                .asList();
        assertThat(list.size(), is(1));
        assertThat(list.get(0).getMyCipherText().getValue(), is("1104"));
    }
View Full Code Here

    public void asListAndFilterInMemoryByGreaterThanOrEqualCriterionOfCipherText()
            throws Exception {
        Hoge hoge1 = new Hoge();
        Hoge hoge2 = new Hoge();
        Hoge hoge3 = new Hoge();
        hoge1.setMyCipherText(new Text("1102"));
        hoge2.setMyCipherText(new Text("1103"));
        hoge3.setMyCipherText(new Text("1104"));
        DatastoreUtil.put(ds, null, DatastoreUtil.modelToEntity(ds, hoge1));
        DatastoreUtil.put(ds, null, DatastoreUtil.modelToEntity(ds, hoge2));
        DatastoreUtil.put(ds, null, DatastoreUtil.modelToEntity(ds, hoge3));
        List<Hoge> list =
            new ModelQuery<Hoge>(ds, meta)
                .filterInMemory(
                    new GreaterThanOrEqualCriterion(meta.myCipherText, "1103"))
                .filterInMemory(
                    new GreaterThanOrEqualCriterion(
                        meta.myCipherText,
                        new Text("1103")))
                .filterInMemory(
                    new InMemoryGreaterThanOrEqualCriterion(
                        meta.myCipherText,
                        "1103"))
                .filterInMemory(
                    new InMemoryGreaterThanOrEqualCriterion(
                        meta.myCipherText,
                        new Text("1103")))
                .sortInMemory(meta.key.asc)
                .asList();
        assertThat(list.size(), is(2));
        assertThat(list.get(0).getMyCipherText().getValue(), is("1103"));
        assertThat(list.get(1).getMyCipherText().getValue(), is("1104"));
View Full Code Here

    public void asListAndFilterInMemoryByInCriterionOfCipherText()
            throws Exception {
        Hoge hoge1 = new Hoge();
        Hoge hoge2 = new Hoge();
        Hoge hoge3 = new Hoge();
        hoge1.setMyCipherText(new Text("1102"));
        hoge2.setMyCipherText(new Text("1103"));
        hoge3.setMyCipherText(new Text("1104"));
        DatastoreUtil.put(ds, null, DatastoreUtil.modelToEntity(ds, hoge1));
        DatastoreUtil.put(ds, null, DatastoreUtil.modelToEntity(ds, hoge2));
        DatastoreUtil.put(ds, null, DatastoreUtil.modelToEntity(ds, hoge3));
        List<Hoge> list =
            new ModelQuery<Hoge>(ds, meta)
                .filterInMemory(
                    new InCriterion(meta.myCipherText, Arrays.asList(
                        "1102",
                        "1104")))
                .filterInMemory(
                    new InCriterion(meta.myCipherText, Arrays.asList(new Text(
                        "1102"), new Text("1104"))))
                .filterInMemory(
                    new InMemoryInCriterion(meta.myCipherText, Arrays.asList(
                        "1102",
                        "1104")))
                .filterInMemory(
                    new InMemoryInCriterion(meta.myCipherText, Arrays.asList(
                        new Text("1102"),
                        new Text("1104"))))
                .sortInMemory(meta.key.asc)
                .asList();
        assertThat(list.size(), is(2));
        assertThat(list.get(0).getMyCipherText().getValue(), is("1102"));
        assertThat(list.get(1).getMyCipherText().getValue(), is("1104"));
View Full Code Here

TOP

Related Classes of com.google.appengine.api.datastore.Text

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.