App Engine - Objectify - saving byte []

I use the Objectify library to interact with the application data store.

In my User class, I store the hashed password as byte[]. When I put it in the data store, it is correctly saved as blob.

When I try to load the object Userback, I get this error:

java.lang.IllegalStateException: Cannot load non-collection value '<Blob: 40 bytes>' into private byte[]

How to fix it?

Should I change my User class to have a hashed type password ShortBlob?

+3
source share
3 answers

Why don't you get Blob(or ShortBlob) and then take it out byte[]of getBytes()?

+3
source

I would try:

0

I suggest using the line md5 'd? Another possibility is that when you try to load a byte, the user was not correctly registered with Objectify. there is a link in the best methods of 'objectify'

http://code.google.com/p/objectify-appengine/wiki/IntroductionToObjectify#Relationships

which offers a static registration of your PoJo classes.

0
source

Source: https://habr.com/ru/post/1740619/


All Articles