@ SuppressWarnings ( "unchecked" ) public < E > List < E > update ( List < E > entities ) { if ( entities == null || entities . isEmpty ( ) ) { return new ArrayList <> ( ) ; } try { Class < E > entityClass = ( Class < E > ) entities . get ( 0 ) . getClass ( ) ; entityManager . executeEntityListeners ( CallbackType . PRE_UPDATE , entities ) ; Intent intent = ( nativeWriter instanceof Batch ) ? Intent . BATCH_UPDATE : Intent . UPDATE ; Entity [ ] nativeEntities = toNativeEntities ( entities , entityManager , intent ) ; nativeWriter . update ( nativeEntities ) ; List < E > updatedEntities = toEntities ( entityClass , nativeEntities ) ; entityManager . executeEntityListeners ( CallbackType . POST_UPDATE , updatedEntities ) ; return updatedEntities ; } catch ( DatastoreException exp ) { throw DatastoreUtils . wrap ( exp ) ; } }
Updates the given list of entities in the Cloud Datastore .