1

これらはすべて基本的な質問ですが、インターネット上には多くの回答が見つかりません。データストアGoogle Cloudからテキストタイプを取得するにはどうすればよいですか?

OK、ここで今、私はこのJavaコード

Text descriptionText=new Text(description); 
structureEntity.setUnindexedProperty("Description",descriptionText); 

を使用してデータストアに挿入アンは、検索コードです:今

Text description=(Text)structureObjectEntity.getProperty("Description");\ 
System.out.println(description); 

、私はデータストアに "We should arrive before dark.<br>I should have finished the book by Friday. <br>The roads should be less crowded today.<br><br>Source: http://www.oxfordlearnersdictionaries.com/definition/english/should?q=should" を挿入し、言わせて

しかし、データを取得するときにSystem.out.println(description);が返されます<Text: We should arrive before dark.<br>I should have finished the book by Fr...>(一部のデータが失われた&があります)<Text:はデータの先頭にあります& ...データの末尾に)&すべてを台無しにしました。

だから、データストアGoogleクラウドからテキストタイプを取得するにはどうすればよいですか?

答えて

3

getValue()メソッドに電話する必要があります。 Textオブジェクトをprintln()に渡すと、toString()メソッドが呼び出されます。 Here are the Javadocs

+0

また、最初にデータストアに文字列データを挿入していないのに、テキストに変更された場合私の他の質問はこちらhttp://stackoverflow.com/questions/36401446/is-changing-data-type-causing-some-problems-on-google-cloud?noredirect=1#comment60424290_36401446 – Tum

関連する問題