/** * Convert {@link Entity} to {@link PersistentResource} object. * @return {@link PersistentResource} object */ public PersistentResource toPersistentResource() { return this.data == null ? null : PersistentResource.loadRecord(this.entityClass, getId().orElse(null), this.requestScope); } }
/** * Convert {@link Entity} to {@link PersistentResource} object. * @return {@link PersistentResource} object */ public PersistentResource toPersistentResource() { return this.data == null ? null : PersistentResource.loadRecord(this.entityClass, getId().orElse(null), this.requestScope); } }
public PersistentResource toPersistentResource(RequestScope requestScope) throws ForbiddenAccessException, InvalidObjectIdentifierException { Class<?> cls = requestScope.getDictionary().getEntityClass(type); return PersistentResource.loadRecord(cls, id, requestScope); }
public PersistentResource toPersistentResource(RequestScope requestScope) throws ForbiddenAccessException, InvalidObjectIdentifierException { Class<?> cls = requestScope.getDictionary().getEntityClass(type); return PersistentResource.loadRecord(cls, id, requestScope); }
public PersistentResource toPersistentResource(RequestScope requestScope) throws ForbiddenAccessException, InvalidObjectIdentifierException { Class<?> cls = requestScope.getDictionary().getEntityClass(type); if (cls == null) { throw new UnknownEntityException(type); } return PersistentResource.loadRecord(cls, id, requestScope); } }
public PersistentResource toPersistentResource(RequestScope requestScope) throws ForbiddenAccessException, InvalidObjectIdentifierException { Class<?> cls = requestScope.getDictionary().getEntityClass(type); if (cls == null) { throw new UnknownEntityException(type); } return PersistentResource.loadRecord(cls, id, requestScope); } }
private PersistentResource<?> entityRecord(StateContext state, EntityContext entity) { String entityName = entity.term().getText(); String id = entity.id().getText(); EntityDictionary dictionary = state.getRequestScope().getDictionary(); Class<?> entityClass = dictionary.getEntityClass(entityName); if (entityClass == null || !dictionary.isRoot(entityClass)) { throw new InvalidCollectionException(entityName); } return PersistentResource.loadRecord(entityClass, id, state.getRequestScope()); } }
private PersistentResource<?> entityRecord(StateContext state, EntityContext entity) { String entityName = entity.term().getText(); String id = entity.id().getText(); EntityDictionary dictionary = state.getRequestScope().getDictionary(); Class<?> entityClass = dictionary.getEntityClass(entityName); if (entityClass == null || !dictionary.isRoot(entityClass)) { throw new InvalidCollectionException(entityName); } return PersistentResource.loadRecord(entityClass, id, state.getRequestScope()); } }