@Override public Key createKey(String kind, Object id) { return this.objectToKeyFactory.getKeyFromId(id, kind); }
private Key getKey(Object entity, boolean allocateKey, Key... ancestors) { DatastorePersistentEntity datastorePersistentEntity = this.datastoreMappingContext .getPersistentEntity(entity.getClass()); DatastorePersistentProperty idProp = datastorePersistentEntity .getIdPropertyOrFail(); if (datastorePersistentEntity.getPropertyAccessor(entity).getProperty(idProp) == null && allocateKey) { return this.objectToKeyFactory.allocateKeyForObject(entity, datastorePersistentEntity, ancestors); } return this.objectToKeyFactory.getKeyFromObject(entity, datastorePersistentEntity); }
private EntityValue applyEntityValueBuilder(String kindName, Consumer<Builder> consumer) { IncompleteKey key = this.objectToKeyFactory.getIncompleteKey(kindName); FullEntity.Builder<IncompleteKey> builder = FullEntity.newBuilder(key); consumer.accept(builder); return EntityValue.of(builder.build()); }
private Key getKey(Object entity, boolean allocateKey, Key... ancestors) { DatastorePersistentEntity datastorePersistentEntity = this.datastoreMappingContext .getPersistentEntity(entity.getClass()); DatastorePersistentProperty idProp = datastorePersistentEntity .getIdPropertyOrFail(); if (datastorePersistentEntity.getPropertyAccessor(entity).getProperty(idProp) == null && allocateKey) { return this.objectToKeyFactory.allocateKeyForObject(entity, datastorePersistentEntity, ancestors); } return this.objectToKeyFactory.getKeyFromObject(entity, datastorePersistentEntity); }
private EntityValue applyEntityValueBuilder(String kindName, Consumer<Builder> consumer) { IncompleteKey key = this.objectToKeyFactory.getIncompleteKey(kindName); FullEntity.Builder<IncompleteKey> builder = FullEntity.newBuilder(key); consumer.accept(builder); return EntityValue.of(builder.build()); }
@Override public Key createKey(String kind, Object id) { return this.objectToKeyFactory.getKeyFromId(id, kind); }
private Key getKeyFromId(Object id, Class entityClass) { return this.objectToKeyFactory.getKeyFromId(id, this.datastoreMappingContext.getPersistentEntity(entityClass).kindName()); }
private Key getKeyFromId(Object id, Class entityClass) { return this.objectToKeyFactory.getKeyFromId(id, this.datastoreMappingContext.getPersistentEntity(entityClass).kindName()); }