There's no special JDO extension for Datastore that will automatically 
treat a String as Text, unfortunately. Even if there was, setting 
'unindexed' for a String property wouldn't be a big enough hint to treat it 
as Text, because there's still a difference in Datastore between an 
unindexed String property and a Text property. If you want to persist a 
Text property in JDO, the way to do it is:

@Persistent
private Text meterOptions;

On Friday, March 3, 2017 at 1:15:26 PM UTC-5, Jim wrote:
>
> Nick,
>
> When I'm using the Datastore Console to manually update the table it will 
> throw an error related to the index if I have the indexing turned on for 
> the field and try to store a large value.  When I turn indexing off I am 
> able to store large strings through the console.
>
> In my Java/JDO code I am unable to store large values under either 
> indexing condition.  I have my class annotated to turn indexing off like 
> this:
>
>     @Persistent
>     @Extension(vendorName="datanucleus", key="gae.unindexed", value="true")
>     private String meterOptions;
>
> Jim
>
>
>
> On Thursday, March 2, 2017 at 5:57:41 PM UTC-6, Nick (Cloud Platform 
> Support) wrote:
>>
>> Hey Jim,
>>
>> Do I understand correctly that you only see the issue when you attempt to 
>> index the field - or what's the same thing - it doesn't occur when you turn 
>> the field's indexing off? 
>>
>> Cheers,
>>
>> Nick
>> Cloud Platform Community Support
>>
>> On Thursday, March 2, 2017 at 1:26:02 PM UTC-5, Jim wrote:
>>>
>>> When I attempt to write a Datastore string longer than 1,500 bytes via 
>>> JDO I get the following error:   "String properties must be 1500 bytes or 
>>> less.  Instead, use com.google.appengine.api.datastore.Text, which can 
>>> store strings of any length."
>>>
>>> I've annotated my class to turn indexing off on this field, and I can 
>>> manually insert strings (much) longer than 1,500 bytes manually via the 
>>> Datastore Console.  
>>>
>>> Is there any way to store larger String values via JDO?  It seems like 
>>> an arbitrary limitation given the fact that I can manually insert larger 
>>> values into the Datastore, and Datastore doc says Strings can be up to ~1MB 
>>> in size.  I know I can convert these to Text but I'd rather not do that if 
>>> I can avoid it.
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/8c1bda79-a473-4507-985e-521a76ae8d45%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to