@Override public Supplier<Pair<Integer, JsonNode>> handlePost(StateContext state) { if (collectionTerminalState.isPresent()) { return collectionTerminalState.get().handlePost(state); } throw new InvalidOperationException("Cannot POST to a record."); }
@Override public Supplier<Pair<Integer, JsonNode>> handlePost(StateContext state) { if (collectionTerminalState.isPresent()) { return collectionTerminalState.get().handlePost(state); } throw new InvalidOperationException("Cannot POST to a record."); }
/** * Get the filter expression for a particular relationship * @param parent The object which has the relationship * @param relationName The relationship name * @return A type specific filter expression for the given relationship */ public Optional<FilterExpression> getExpressionForRelation(PersistentResource parent, String relationName) { final Class<?> entityClass = dictionary.getParameterizedType(parent.getObject(), relationName); if (entityClass == null) { throw new InvalidAttributeException(relationName, parent.getType()); } if (dictionary.isMappedInterface(entityClass) && interfaceHasFilterExpression(entityClass)) { throw new InvalidOperationException( "Cannot apply filters to polymorphic relations mapped with MappedInterface"); } final String valType = dictionary.getJsonAliasFor(entityClass); return getFilterExpressionByType(valType); }
/** * Get the filter expression for a particular relationship * @param parent The object which has the relationship * @param relationName The relationship name * @return A type specific filter expression for the given relationship */ public Optional<FilterExpression> getExpressionForRelation(PersistentResource parent, String relationName) { final Class<?> entityClass = dictionary.getParameterizedType(parent.getObject(), relationName); if (entityClass == null) { throw new InvalidAttributeException(relationName, parent.getType()); } if (dictionary.isMappedInterface(entityClass) && interfaceHasFilterExpression(entityClass)) { throw new InvalidOperationException( "Cannot apply filters to polymorphic relations mapped with MappedInterface"); } final String valType = dictionary.getJsonAliasFor(entityClass); return getFilterExpressionByType(valType); }