Package com.google.appengine.api.datastore

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


    public String getStr() {
      return str != null ? str.getValue() : null;
    }

    public void setStr(String str) {
      this.str = str != null ? new Text(str) : null;
    }
View Full Code Here


    public String getStr() {
      return str != null ? str.getValue() : null;
    }

    public void setStr(String str) {
      this.str = str != null ? new Text(str) : null;
    }
View Full Code Here

  public void testInsert() throws EntityNotFoundException, IllegalAccessException {
    HasUnindexedPropertiesJDO pojo = new HasUnindexedPropertiesJDO();
    pojo.setUnindexedString("str");
    pojo.setUnindexedList(Utils.newArrayList("a", "b", "c"));
    pojo.setUnindexedText(new Text("unindexed text"));
    pojo.setUnindexedBlob(new Blob("unindexed blob".getBytes()));
    pojo.setText(new Text("text"));
    pojo.setBlob(new Blob("blob".getBytes()));

    beginTxn();
    pm.makePersistent(pojo);
    commitTxn();
View Full Code Here

  public static class StringToText implements SpecificTypeConverter<String, Text>
  {
    public Text convert(String source)
    {
      return new Text(source);
    }
View Full Code Here

    this.articleUrl = articleUrl;
    this.videoId = videoId;
    this.assignmentId = assignmentId;
    this.youTubeName = uploader;
    this.videoTitle = title;
    this.videoDescription = new Text(description);
    this.videoTags = tagList;
    this.youTubeState = "UNKNOWN";
    this.created = new Date();
    this.updated = this.created;
    this.lastSynced = this.created;
View Full Code Here

  public String getVideoDescription() {
    return videoDescription.getValue();
  }

  public void setVideoDescription(String videoDescription) {
    this.videoDescription = new Text(videoDescription);
  }
View Full Code Here

    }

    @Override
    public Text deserialize(JsonElement json, Type type, JsonDeserializationContext context) {
      try {
        return new Text(json.getAsString());
      } catch (JsonParseException e) {
        // TODO: This is kind of a hacky way of reporting back a parse
        // exception.
        return new Text(e.toString());
      }
    }
View Full Code Here

      Object valueToStore = value;
      AbstractMemberMetaData mmd = getMetaData(fieldNumber);
      if (mmd.getColumnMetaData() != null &&
          mmd.getColumnMetaData().length == 1) {
        if ("CLOB".equals(mmd.getColumnMetaData()[0].getJdbcType())) {
          valueToStore = new Text(value);
        }/* else if (mmd.getColumnMetaData()[0].getLength() > 500) {
          // Can only store up to 500 characters in String, so use Text
          valueToStore = new Text(value);
        }*/
      }
View Full Code Here

    beginTxn();
    em.persist(pojo);
    commitTxn();

    Entity e = ds.get(KeyFactory.createKey(HasLob.class.getSimpleName(), pojo.getId()));
    assertEquals(new Text("a really big string"), e.getProperty("bigString"));
    assertEquals(new Blob("a really big byte array".getBytes()), e.getProperty("bigByteArray"));
    assertEquals(new Blob(SerializationManager.DEFAULT_SERIALIZATION_STRATEGY.serialize(
        Utils.newArrayList(now)).getBytes()), e.getProperty("dateList"));
  }
View Full Code Here

        Utils.newArrayList(now)).getBytes()), e.getProperty("dateList"));
  }

  public void testFetch() {
    Entity e = new Entity(HasLob.class.getSimpleName());
    e.setProperty("bigString", new Text("a really big string"));
    e.setProperty("bigByteArray", new Blob("a really big byte array".getBytes()));
    Date now = new Date();
    e.setProperty("dateList", new Blob(SerializationManager.DEFAULT_SERIALIZATION_STRATEGY.serialize(
        Utils.newArrayList(now)).getBytes()));
    ds.put(e);
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.