/** * Checks to see if any filters are meant to to applied to a polymorphic Any/ManyToAny relationship. * @param entityInterface a @MappedInterface * @return whether or not there are any typed filter expressions meant for this polymorphic interface */ private boolean interfaceHasFilterExpression(Class<?> entityInterface) { for (String filterType : expressionsByType.keySet()) { Class<?> polyMorphicClass = dictionary.getEntityClass(filterType); if (entityInterface.isAssignableFrom(polyMorphicClass)) { return true; } } return false; }
/** * Checks to see if any filters are meant to to applied to a polymorphic Any/ManyToAny relationship. * @param entityInterface a @MappedInterface * @return whether or not there are any typed filter expressions meant for this polymorphic interface */ private boolean interfaceHasFilterExpression(Class<?> entityInterface) { for (String filterType : expressionsByType.keySet()) { Class<?> polyMorphicClass = dictionary.getEntityClass(filterType); if (entityInterface.isAssignableFrom(polyMorphicClass)) { return true; } } return false; }
/** * Fetch all entity classes that the provided entity inherits from (i.e. all superclass entities down to, * but excluding Object). * * @param entityName Json alias name for entity * @return List of all super class entity classes */ public List<Class<?>> getSuperClassEntities(String entityName) { return getSuperClassEntities(getEntityClass(entityName)); }
/** * Get inherited entity names for a particular entity. * * @param entityName Json alias name for entity * @return List of all inherited entity type names */ public List<String> getSubclassingEntityNames(String entityName) { return getSubclassingEntityNames(getEntityClass(entityName)); }
/** * Get a list of inherited entities from a particular entity. * Namely, the list of entities inheriting from the provided class. * * @param entityName Json alias name for entity * @return List of all inherited entity types */ public List<Class<?>> getSubclassingEntities(String entityName) { return getSubclassingEntities(getEntityClass(entityName)); }
/** * Fetch all entity classes that the provided entity inherits from (i.e. all superclass entities down to, * but excluding Object). * * @param entityName Json alias name for entity * @return List of all super class entity classes */ public List<Class<?>> getSuperClassEntities(String entityName) { return getSuperClassEntities(getEntityClass(entityName)); }
/** * Get inherited entity names for a particular entity. * * @param entityName Json alias name for entity * @return List of all inherited entity type names */ public List<String> getSubclassingEntityNames(String entityName) { return getSubclassingEntityNames(getEntityClass(entityName)); }
/** * Get a list of inherited entities from a particular entity. * Namely, the list of entities inheriting from the provided class. * * @param entityName Json alias name for entity * @return List of all inherited entity types */ public List<Class<?>> getSubclassingEntities(String entityName) { return getSubclassingEntities(getEntityClass(entityName)); }
/** * Fetch all entity names that the provided entity inherits from (i.e. all superclass entities down to, * but excluding Object). * * @param entityName Json alias name for entity * @return List of all super class entity json names */ public List<String> getSuperClassEntityNames(String entityName) { return getSuperClassEntityNames(getEntityClass(entityName)); }
/** * Fetch all entity names that the provided entity inherits from (i.e. all superclass entities down to, * but excluding Object). * * @param entityName Json alias name for entity * @return List of all super class entity json names */ public List<String> getSuperClassEntityNames(String entityName) { return getSuperClassEntityNames(getEntityClass(entityName)); }
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); } }
@Override public Object processFetch(Environment context, PersistentResourceFetcher fetcher) { EntityDictionary dictionary = context.requestScope.getDictionary(); Class<?> entityClass = dictionary.getEntityClass(context.field.getName()); boolean generateTotals = requestContainsPageInfo(context.field); return fetcher.fetchObject(context, context.requestScope, entityClass, context.ids, context.sort, context.offset, context.first, context.filters, generateTotals); }
@Override public Object processFetch(Environment context, PersistentResourceFetcher fetcher) { EntityDictionary dictionary = context.requestScope.getDictionary(); Class<?> entityClass = dictionary.getEntityClass(context.field.getName()); boolean generateTotals = requestContainsPageInfo(context.field); return fetcher.fetchObject(context, context.requestScope, entityClass, context.ids, context.sort, context.offset, context.first, context.filters, generateTotals); }
@Override public void handle(StateContext state, RootCollectionLoadEntitiesContext ctx) { String entityName = ctx.term().getText(); EntityDictionary dictionary = state.getRequestScope().getDictionary(); Class<?> entityClass = dictionary.getEntityClass(entityName); if (entityClass == null || !dictionary.isRoot(entityClass)) { throw new InvalidCollectionException(entityName); } state.setState(new CollectionTerminalState(entityClass, Optional.empty(), Optional.empty())); }
@Override public void handle(StateContext state, RootCollectionLoadEntitiesContext ctx) { String entityName = ctx.term().getText(); EntityDictionary dictionary = state.getRequestScope().getDictionary(); Class<?> entityClass = dictionary.getEntityClass(entityName); if (entityClass == null || !dictionary.isRoot(entityClass)) { throw new InvalidCollectionException(entityName); } state.setState(new CollectionTerminalState(entityClass, Optional.empty(), Optional.empty())); }
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()); } }