entityName.setProperty("textProperty", text)
「テキスト」がテキスト型オブジェクトである場所を使用して、いくつかの大きなテキスト データをテキスト オブジェクトとして Google アプリ エンジン データストアに保存します。テキストを取得しようとするとentityName.getProperty("textProperty");
、オブジェクトを返し、それを Text オブジェクトとして保存するので、それを Text を使用してキャストするだけ
ですが、アプリケーションが文字列として保存するように見えるので、そうし(Text)entityName.getProperty("textProperty");
ます
しかし、それは私にこれを与えます
java.lang.ClassCastException: java.lang.String cannot be cast to com.google.appengine.api.datastore.Text
(String)entityName.getProperty("textProperty");
java.lang.ClassCastException: com.google.appengine.api.datastore.Text cannot be cast to java.lang.String
混乱しています。データストアから Text オブジェクトを取得するにはどうすればよいですか?