com.google.cloud.backend.mobilebackend.model.EntityDto

Here are the examples of the java api class com.google.cloud.backend.mobilebackend.model.EntityDto taken from open source projects.

1. CloudEntity#getEntityDto()

Project: io2014-codelabs
File: CloudEntity.java
protected EntityDto getEntityDto() {
    EntityDto co = new EntityDto();
    co.setId(id);
    if (createdAt != null) {
        co.setCreatedAt(new DateTime(createdAt));
    }
    co.setCreatedBy(createdBy);
    co.setKindName(kindName);
    if (updatedAt != null) {
        co.setUpdatedAt(new DateTime(updatedAt));
    }
    co.setUpdatedBy(updatedBy);
    co.setProperties(properties);
    co.setOwner(owner);
    return co;
}

2. CloudBackend#get()

Project: io2014-codelabs
File: CloudBackend.java
/**
     * Reads the specified {@link CloudEntity} synchronously.
     *
     * @param kindName Name of the table for the CloudEntity to get.
     * @param id       Id of the CloudEntity to find.
     * @return {@link CloudEntity}.
     * @throws java.io.IOException When the call had failed for any reason.
     */
public CloudEntity get(String kindName, String id) throws IOException {
    EntityDto cd = getMBSEndpoint().endpointV1().get(kindName, id).execute();
    CloudEntity co = CloudEntity.createCloudEntityFromEntityDto(cd);
    Log.i(Consts.TAG, "get: result: " + co);
    return co;
}

3. CloudBackend#update()

Project: io2014-codelabs
File: CloudBackend.java
/**
     * Updates the specified {@link CloudEntity} on the backend synchronously.
     * If it does not have any Id, it creates a new Entity. If it has, find the
     * existing entity and update it.
     *
     * @param ce {@link com.google.cloud.backend.core.CloudEntity} for updating a CloudEntity.
     * @return {@link CloudEntity} that has updated fields (like updatedAt and
     * new Id).
     * @throws java.io.IOException When the call had failed for any reason.
     */
public CloudEntity update(CloudEntity ce) throws IOException {
    EntityDto resultEntityDto = getMBSEndpoint().endpointV1().update(ce.getKindName(), ce.getEntityDto()).execute();
    CloudEntity resultCo = CloudEntity.createCloudEntityFromEntityDto(resultEntityDto);
    Log.i(Consts.TAG, "update: updated: " + resultCo);
    return resultCo;
}

4. CloudBackend#insert()

Project: io2014-codelabs
File: CloudBackend.java
/**
     * Inserts a CloudEntity into the backend synchronously.
     *
     * @param ce {@link com.google.cloud.backend.core.CloudEntity} for inserting a CloudEntity.
     * @return {@link com.google.cloud.backend.core.CloudEntity} that has updated fields (like updatedAt and
     * new Id).
     * @throws java.io.IOException When the call had failed for any reason.
     */
public CloudEntity insert(CloudEntity ce) throws IOException {
    EntityDto resultEntityDto = getMBSEndpoint().endpointV1().insert(ce.getKindName(), ce.getEntityDto()).execute();
    CloudEntity resultCo = CloudEntity.createCloudEntityFromEntityDto(resultEntityDto);
    Log.i(Consts.TAG, "insert: inserted: " + resultCo);
    return resultCo;
}