So let's take a look at the code for
getting the profile out of the data store. So
here's the getProfile method. Throws an exception if the
user is not authorized. We get the key, get the
user ID to use as the ID for the key. We create the key, and then we get the
profile. Now ofy.load returns an object. So, in this
case, we want it to be kind profile, class profile.
So, we have to cast it as a profile
Demos un vistazo al código
para sacar el perfil
fuera del almacén de datos.
Este es el método getProfile.
Permite una escepción
si el usuario no está autorizado.
Obtenemos la clave y la ID de usuario
para usar como la ID
para la clave.
Creamos la clave
y luego obtenemos el perfil.
Ahora, ofy.load
regresa un objeto.
En este caso optamos por que sea
un tipo de perfil, class Profile,
así que tenemos que moldearlo
como un perfil.
Datastoreからprofileを
取得するコードを見てみましょう
ここにgetProfileメソッドがあります
ユーザが認証されていない場合は
例外をスローします
keyのIDとして使用するuserIdを取得します
そしてkeyを作成したら
Profileを取得します
ofy().load()はオブジェクトを返します
ここではProfileクラスのprofileが必要なので
Profileにキャストする必要があります
Vamos dar uma olhada no código
para pegar o perfil
do armazenamento de dados.
Esse é o método getProfile.
Coloque uma exceção se o usuário
não está autorizado.
Pegamos a chave, pegue a user id
para usar como ID para a chave.
Criamos a chave, e então pegamos o perfil.
Agora ofy.load retorna como um objeto.
Então, nesse caso, queremos que seja
um tipo de perfil, perfil de classe.
Temos que achar que é um perfil.