Set<EntityId> assetIds) {
try {
C entity = componentEntityAdapter.getEntityClass().newInstance();
// set type-specific, then base/system-controlled properties
componentEntityAdapter.populateEntity(componentDocument, entity);
Component component = (Component) entity;
component.setId(new EntityId((String) componentDocument.field(P_ID)));
component.setAssetIds(assetIds);
return entity;
}
catch (Throwable t) {
throw Throwables.propagate(t);
}