private void addGreeting ( String guestbookName , String user , String message ) throws DatastoreException { Entity . Builder greeting = Entity . newBuilder ( ) ; greeting . setKey ( makeKey ( GUESTBOOK_KIND , guestbookName , GREETING_KIND ) ) ; greeting . getMutableProperties ( ) . put ( USER_PROPERTY , makeValue ( user ) . build ( ) ) ; greeting . getMutableProperties ( ) . put ( MESSAGE_PROPERTY , makeValue ( message ) . build ( ) ) ; greeting . getMutableProperties ( ) . put ( DATE_PROPERTY , makeValue ( new Date ( ) ) . build ( ) ) ; Key greetingKey = insert ( greeting . build ( ) ) ; System . out . println ( "greeting key is: " + greetingKey ) ; }
Add a greeting to the specified guestbook .