Search in sources :

Example 16 with Type

use of com.yahoo.elide.core.type.Type in project elide by yahoo.

the class RootCollectionFetchQueryBuilder method build.

/**
 * Constructs a query that fetches a root collection.
 *
 * @return the constructed query
 */
@Override
public Query build() {
    Type<?> entityClass = this.entityProjection.getType();
    String entityName = entityClass.getCanonicalName();
    String entityAlias = getTypeAlias(entityClass);
    Query query;
    FilterExpression filterExpression = entityProjection.getFilterExpression();
    if (filterExpression != null) {
        PredicateExtractionVisitor extractor = new PredicateExtractionVisitor();
        Collection<FilterPredicate> predicates = filterExpression.accept(extractor);
        // Build the WHERE clause
        String filterClause = WHERE + new FilterTranslator(dictionary).apply(filterExpression, USE_ALIAS);
        // Build the JOIN clause
        String joinClause = getJoinClauseFromFilters(filterExpression) + getJoinClauseFromSort(entityProjection.getSorting()) + extractToOneMergeJoins(entityClass, entityAlias);
        boolean requiresDistinct = entityProjection.getPagination() != null && containsOneToMany(filterExpression);
        boolean sortOverRelationship = entityProjection.getSorting() != null && entityProjection.getSorting().getSortingPaths().keySet().stream().anyMatch(path -> path.getPathElements().size() > 1);
        if (requiresDistinct && sortOverRelationship) {
            // SQL does not support distinct and order by on columns which are not selected
            throw new InvalidValueException("Combination of pagination, sorting over relationship and" + " filtering over toMany relationships unsupported");
        }
        query = session.createQuery(SELECT + (requiresDistinct ? DISTINCT : "") + entityAlias + FROM + entityName + AS + entityAlias + SPACE + joinClause + SPACE + filterClause + SPACE + getSortClause(entityProjection.getSorting()));
        // Fill in the query parameters
        supplyFilterQueryParameters(query, predicates);
    } else {
        query = session.createQuery(SELECT + entityAlias + FROM + entityName + AS + entityAlias + SPACE + getJoinClauseFromSort(entityProjection.getSorting()) + extractToOneMergeJoins(entityClass, entityAlias) + SPACE + getSortClause(entityProjection.getSorting()));
    }
    addPaginationToQuery(query);
    return query;
}
Also used : PredicateExtractionVisitor(com.yahoo.elide.core.filter.expression.PredicateExtractionVisitor) FilterPredicate(com.yahoo.elide.core.filter.predicates.FilterPredicate) InvalidValueException(com.yahoo.elide.core.exceptions.InvalidValueException) Type(com.yahoo.elide.core.type.Type) Collection(java.util.Collection) TypeHelper.getTypeAlias(com.yahoo.elide.core.utils.TypeHelper.getTypeAlias) EntityProjection(com.yahoo.elide.core.request.EntityProjection) Session(com.yahoo.elide.datastores.jpql.porting.Session) FilterTranslator(com.yahoo.elide.datastores.jpql.filter.FilterTranslator) FilterExpression(com.yahoo.elide.core.filter.expression.FilterExpression) EntityDictionary(com.yahoo.elide.core.dictionary.EntityDictionary) Query(com.yahoo.elide.datastores.jpql.porting.Query) InvalidValueException(com.yahoo.elide.core.exceptions.InvalidValueException) Query(com.yahoo.elide.datastores.jpql.porting.Query) PredicateExtractionVisitor(com.yahoo.elide.core.filter.expression.PredicateExtractionVisitor) FilterPredicate(com.yahoo.elide.core.filter.predicates.FilterPredicate) FilterExpression(com.yahoo.elide.core.filter.expression.FilterExpression) FilterTranslator(com.yahoo.elide.datastores.jpql.filter.FilterTranslator)

Example 17 with Type

use of com.yahoo.elide.core.type.Type in project elide by yahoo.

the class SubscriptionModelBuilder method build.

/**
 * Builds a GraphQL schema.
 * @return The built schema.
 */
public GraphQLSchema build() {
    Set<Type<?>> allClasses = entityDictionary.getBoundClassesByVersion(apiVersion);
    if (allClasses.isEmpty()) {
        throw new IllegalArgumentException("None of the provided classes are exported by Elide");
    }
    Set<Type<?>> subscriptionClasses = allClasses.stream().filter((cls) -> entityDictionary.getAnnotation(cls, Subscription.class) != null).collect(Collectors.toSet());
    /* Construct root object */
    GraphQLObjectType.Builder root = newObject().name("Subscription");
    for (Type<?> clazz : subscriptionClasses) {
        Subscription subscription = entityDictionary.getAnnotation(clazz, Subscription.class);
        if (subscription == null) {
            continue;
        }
        GraphQLObjectType subscriptionType = buildQueryObject(clazz);
        String entityName = entityDictionary.getJsonAliasFor(clazz);
        GraphQLFieldDefinition.Builder rootFieldDefinitionBuilder = newFieldDefinition().name(entityName).description(EntityDictionary.getEntityDescription(clazz)).argument(filterArgument).type(subscriptionType);
        if (subscription.operations() != null && subscription.operations().length > 0) {
            GraphQLEnumType.Builder topicTypeBuilder = newEnum().name(nameUtils.toTopicName(clazz));
            for (Subscription.Operation operation : subscription.operations()) {
                TopicType topicType = TopicType.fromOperation(operation);
                topicTypeBuilder.value(topicType.name(), topicType);
            }
            topicTypeBuilder.definition(EnumTypeDefinition.newEnumTypeDefinition().build());
            rootFieldDefinitionBuilder.argument(GraphQLArgument.newArgument().name(TOPIC_ARGUMENT).type(topicTypeBuilder.build()).build());
        }
        root.field(rootFieldDefinitionBuilder.build());
    }
    GraphQLObjectType queryRoot = root.build();
    for (Type<?> relationshipType : relationshipTypes) {
        this.buildQueryObject(relationshipType);
    }
    // Attach the client provided dataFetcher to all of the GraphQL subscription objects.
    GraphQLCodeRegistry.Builder codeRegistry = GraphQLCodeRegistry.newCodeRegistry();
    Set<GraphQLObjectType> objectsThatNeedAFetcher = new HashSet<>(queryObjectRegistry.values());
    objectsThatNeedAFetcher.addAll(generator.getObjectTypes());
    objectsThatNeedAFetcher.add(queryRoot);
    for (GraphQLObjectType objectType : objectsThatNeedAFetcher) {
        String objectName = objectType.getName();
        for (GraphQLFieldDefinition fieldDefinition : objectType.getFieldDefinitions()) {
            codeRegistry.dataFetcher(FieldCoordinates.coordinates(objectName, fieldDefinition.getName()), dataFetcher);
        }
    }
    /* Construct the schema */
    GraphQLSchema schema = GraphQLSchema.newSchema().subscription(queryRoot).query(queryRoot).codeRegistry(codeRegistry.build()).additionalTypes(Sets.newHashSet(queryObjectRegistry.values())).build();
    return schema;
}
Also used : FieldCoordinates(graphql.schema.FieldCoordinates) GraphQLConversionUtils(com.yahoo.elide.graphql.GraphQLConversionUtils) GraphQLCodeRegistry(graphql.schema.GraphQLCodeRegistry) NonEntityDictionary(com.yahoo.elide.graphql.NonEntityDictionary) GraphQLFieldDefinition(graphql.schema.GraphQLFieldDefinition) TopicType(com.yahoo.elide.graphql.subscriptions.hooks.TopicType) HashMap(java.util.HashMap) GraphQLType(graphql.schema.GraphQLType) EnumTypeDefinition(graphql.language.EnumTypeDefinition) HashSet(java.util.HashSet) Scalars(graphql.Scalars) Map(java.util.Map) DataFetcher(graphql.schema.DataFetcher) GraphQLSchema(graphql.schema.GraphQLSchema) GraphQLObjectType(graphql.schema.GraphQLObjectType) Subscription(com.yahoo.elide.graphql.subscriptions.annotations.Subscription) GraphQLNameUtils(com.yahoo.elide.graphql.GraphQLNameUtils) GraphQLArgument.newArgument(graphql.schema.GraphQLArgument.newArgument) Set(java.util.Set) GraphQLOutputType(graphql.schema.GraphQLOutputType) GraphQLArgument(graphql.schema.GraphQLArgument) Collectors(java.util.stream.Collectors) EntityDictionary(com.yahoo.elide.core.dictionary.EntityDictionary) Sets(com.google.common.collect.Sets) GraphQLFieldDefinition.newFieldDefinition(graphql.schema.GraphQLFieldDefinition.newFieldDefinition) SubscriptionField(com.yahoo.elide.graphql.subscriptions.annotations.SubscriptionField) GraphQLScalars(com.yahoo.elide.graphql.GraphQLScalars) Slf4j(lombok.extern.slf4j.Slf4j) GraphQLList(graphql.schema.GraphQLList) GraphQLTypeReference(graphql.schema.GraphQLTypeReference) GraphQLEnumType.newEnum(graphql.schema.GraphQLEnumType.newEnum) GraphQLObjectType.newObject(graphql.schema.GraphQLObjectType.newObject) Type(com.yahoo.elide.core.type.Type) GraphQLEnumType(graphql.schema.GraphQLEnumType) RelationshipType(com.yahoo.elide.core.dictionary.RelationshipType) GraphQLEnumType(graphql.schema.GraphQLEnumType) GraphQLFieldDefinition(graphql.schema.GraphQLFieldDefinition) GraphQLSchema(graphql.schema.GraphQLSchema) TopicType(com.yahoo.elide.graphql.subscriptions.hooks.TopicType) TopicType(com.yahoo.elide.graphql.subscriptions.hooks.TopicType) GraphQLType(graphql.schema.GraphQLType) GraphQLObjectType(graphql.schema.GraphQLObjectType) GraphQLOutputType(graphql.schema.GraphQLOutputType) Type(com.yahoo.elide.core.type.Type) GraphQLEnumType(graphql.schema.GraphQLEnumType) RelationshipType(com.yahoo.elide.core.dictionary.RelationshipType) GraphQLObjectType(graphql.schema.GraphQLObjectType) GraphQLCodeRegistry(graphql.schema.GraphQLCodeRegistry) Subscription(com.yahoo.elide.graphql.subscriptions.annotations.Subscription) HashSet(java.util.HashSet)

Example 18 with Type

use of com.yahoo.elide.core.type.Type in project elide by yahoo.

the class JsonApiModelResolver method resolve.

@Override
public Model resolve(java.lang.reflect.Type type, ModelConverterContext context, Iterator<ModelConverter> next) {
    if (!(type instanceof Class || type instanceof SimpleType || type instanceof Type)) {
        return super.resolve(type, context, next);
    }
    Type<?> clazzType = null;
    /*
         * If an Elide entity is an attribute somewhere in a model, the ModelResolver will
         * end up wrapping this as a SimpleType (rather than trying to resolve the entity class directly).
         */
    if (type instanceof SimpleType) {
        type = ((SimpleType) type).getRawClass();
        clazzType = ClassType.of((Class<?>) type);
    } else if (type instanceof Type) {
        clazzType = (Type<?>) type;
    } else if (type instanceof Class) {
        clazzType = ClassType.of((Class<?>) type);
    }
    /* Not an entity managed by Elide, let Swagger convert it */
    String typeAlias;
    try {
        typeAlias = dictionary.getJsonAliasFor(clazzType);
    } catch (IllegalArgumentException e) {
        return super.resolve(type, context, next);
    }
    Resource entitySchema = new Resource();
    entitySchema.description(getModelDescription(clazzType));
    entitySchema.setSecurityDescription(getClassPermissions(clazzType));
    /* Populate the attributes */
    List<String> attributeNames = dictionary.getAttributes(clazzType);
    for (String attributeName : attributeNames) {
        Type<?> attributeType = dictionary.getType(clazzType, attributeName);
        Property attribute = processAttribute(clazzType, attributeName, attributeType, context, next);
        entitySchema.addAttribute(attributeName, attribute);
    }
    /* Populate the relationships */
    List<String> relationshipNames = dictionary.getRelationships(clazzType);
    for (String relationshipName : relationshipNames) {
        Type<?> relationshipType = dictionary.getParameterizedType(clazzType, relationshipName);
        Relationship relationship = processRelationship(clazzType, relationshipName, relationshipType);
        if (relationship != null) {
            entitySchema.addRelationship(relationshipName, relationship);
        }
    }
    entitySchema.name(typeAlias);
    return entitySchema;
}
Also used : SimpleType(com.fasterxml.jackson.databind.type.SimpleType) SimpleType(com.fasterxml.jackson.databind.type.SimpleType) ClassType(com.yahoo.elide.core.type.ClassType) Type(com.yahoo.elide.core.type.Type) Relationship(com.yahoo.elide.swagger.property.Relationship) Resource(com.yahoo.elide.swagger.model.Resource) ApiModelProperty(io.swagger.annotations.ApiModelProperty) Property(io.swagger.models.properties.Property)

Example 19 with Type

use of com.yahoo.elide.core.type.Type in project elide by yahoo.

the class PersistentResource method getRelation.

/**
 * Load a relation from the PersistentResource.
 *
 * @param relationship the relation
 * @param ids          a list of object identifiers to optionally load.  Can be empty.
 * @return PersistentResource relation
 */
public Observable<PersistentResource> getRelation(List<String> ids, com.yahoo.elide.core.request.Relationship relationship) {
    FilterExpression filterExpression = Optional.ofNullable(relationship.getProjection().getFilterExpression()).orElse(null);
    assertPropertyExists(relationship.getName());
    Type<?> entityType = dictionary.getParameterizedType(getResourceType(), relationship.getName());
    Set<PersistentResource> newResources = new LinkedHashSet<>();
    /* If this is a bulk edit request and the ID we are fetching for is newly created... */
    if (!ids.isEmpty()) {
        // Fetch our set of new resources that we know about since we can't find them in the datastore
        newResources = requestScope.getNewPersistentResources().stream().filter(resource -> entityType.isAssignableFrom(resource.getResourceType()) && ids.contains(resource.getUUID().orElse(""))).collect(Collectors.toSet());
        FilterExpression idExpression = buildIdFilterExpression(ids, entityType, dictionary, requestScope);
        // Combine filters if necessary
        filterExpression = Optional.ofNullable(relationship.getProjection().getFilterExpression()).map(fe -> (FilterExpression) new AndFilterExpression(idExpression, fe)).orElse(idExpression);
    }
    // TODO: Filter on new resources?
    // TODO: Update pagination to subtract the number of new resources created?
    Observable<PersistentResource> existingResources = filter(ReadPermission.class, Optional.ofNullable(filterExpression), relationship.getProjection().getRequestedFields(), getRelation(relationship.copyOf().projection(relationship.getProjection().copyOf().filterExpression(filterExpression).build()).build(), true));
    // TODO: Sort again in memory now that two sets are glommed together?
    Observable<PersistentResource> allResources = Observable.fromIterable(newResources).mergeWith(existingResources);
    Set<String> foundIds = new HashSet<>();
    allResources = allResources.doOnNext((resource) -> {
        String id = (String) (resource.getUUID().orElseGet(resource::getId));
        if (ids.contains(id)) {
            foundIds.add(id);
        }
    });
    allResources = allResources.doOnComplete(() -> {
        Set<String> missedIds = Sets.difference(new HashSet<>(ids), foundIds);
        if (!missedIds.isEmpty()) {
            throw new InvalidObjectIdentifierException(missedIds.toString(), relationship.getName());
        }
    });
    return allResources;
}
Also used : LinkedHashSet(java.util.LinkedHashSet) Resource(com.yahoo.elide.jsonapi.models.Resource) Data(com.yahoo.elide.jsonapi.models.Data) StringUtils(org.apache.commons.lang3.StringUtils) UpdatePermission(com.yahoo.elide.annotation.UpdatePermission) ClassType(com.yahoo.elide.core.type.ClassType) DeletePermission(com.yahoo.elide.annotation.DeletePermission) Argument(com.yahoo.elide.core.request.Argument) InvalidSyntaxException(com.yahoo.elide.core.audit.InvalidSyntaxException) Map(java.util.Map) DataStoreIterable(com.yahoo.elide.core.datastore.DataStoreIterable) LifeCycleHookBinding(com.yahoo.elide.annotation.LifeCycleHookBinding) EntityBinding(com.yahoo.elide.core.dictionary.EntityBinding) NonNull(lombok.NonNull) Collection(java.util.Collection) Set(java.util.Set) CoerceUtil(com.yahoo.elide.core.utils.coerce.CoerceUtil) Collectors(java.util.stream.Collectors) EntityDictionary(com.yahoo.elide.core.dictionary.EntityDictionary) Sets(com.google.common.collect.Sets) Serializable(java.io.Serializable) Objects(java.util.Objects) ExpressionResult(com.yahoo.elide.core.security.permissions.ExpressionResult) List(java.util.List) Annotation(java.lang.annotation.Annotation) AndFilterExpression(com.yahoo.elide.core.filter.expression.AndFilterExpression) Optional(java.util.Optional) RelationshipType(com.yahoo.elide.core.dictionary.RelationshipType) Attribute(com.yahoo.elide.core.request.Attribute) InvalidAttributeException(com.yahoo.elide.core.exceptions.InvalidAttributeException) Function(java.util.function.Function) Supplier(java.util.function.Supplier) CollectionUtils(org.apache.commons.collections4.CollectionUtils) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) LinkedHashMap(java.util.LinkedHashMap) IterableUtils(org.apache.commons.collections4.IterableUtils) LogMessageImpl(com.yahoo.elide.core.audit.LogMessageImpl) DELETE(com.yahoo.elide.annotation.LifeCycleHookBinding.Operation.DELETE) EntityDictionary.getType(com.yahoo.elide.core.dictionary.EntityDictionary.getType) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore) Predicates(com.google.common.base.Predicates) InternalServerErrorException(com.yahoo.elide.core.exceptions.InternalServerErrorException) CanPaginateVisitor(com.yahoo.elide.core.security.visitors.CanPaginateVisitor) Observable(io.reactivex.Observable) LogMessage(com.yahoo.elide.core.audit.LogMessage) FilterExpression(com.yahoo.elide.core.filter.expression.FilterExpression) LinkedHashSet(java.util.LinkedHashSet) UPDATE(com.yahoo.elide.annotation.LifeCycleHookBinding.Operation.UPDATE) DataStoreTransaction(com.yahoo.elide.core.datastore.DataStoreTransaction) VerifyFieldAccessFilterExpressionVisitor(com.yahoo.elide.core.filter.visitors.VerifyFieldAccessFilterExpressionVisitor) ChangeSpec(com.yahoo.elide.core.security.ChangeSpec) COLLECTION_TYPE(com.yahoo.elide.core.type.ClassType.COLLECTION_TYPE) Sorting(com.yahoo.elide.core.request.Sorting) InvalidEntityBodyException(com.yahoo.elide.core.exceptions.InvalidEntityBodyException) InvalidObjectIdentifierException(com.yahoo.elide.core.exceptions.InvalidObjectIdentifierException) InPredicate(com.yahoo.elide.core.filter.predicates.InPredicate) EntityProjection(com.yahoo.elide.core.request.EntityProjection) Relationship(com.yahoo.elide.jsonapi.models.Relationship) ForbiddenAccessException(com.yahoo.elide.core.exceptions.ForbiddenAccessException) ReadPermission(com.yahoo.elide.annotation.ReadPermission) BadRequestException(com.yahoo.elide.core.exceptions.BadRequestException) Pagination(com.yahoo.elide.core.request.Pagination) ResourceIdentifier(com.yahoo.elide.jsonapi.models.ResourceIdentifier) TreeMap(java.util.TreeMap) CreatePermission(com.yahoo.elide.annotation.CreatePermission) CREATE(com.yahoo.elide.annotation.LifeCycleHookBinding.Operation.CREATE) Type(com.yahoo.elide.core.type.Type) Preconditions(com.google.common.base.Preconditions) Comparator(java.util.Comparator) Collections(java.util.Collections) EMPTY_BINDING(com.yahoo.elide.core.dictionary.EntityBinding.EMPTY_BINDING) Audit(com.yahoo.elide.annotation.Audit) NonTransferable(com.yahoo.elide.annotation.NonTransferable) Set(java.util.Set) HashSet(java.util.HashSet) LinkedHashSet(java.util.LinkedHashSet) InvalidObjectIdentifierException(com.yahoo.elide.core.exceptions.InvalidObjectIdentifierException) AndFilterExpression(com.yahoo.elide.core.filter.expression.AndFilterExpression) FilterExpression(com.yahoo.elide.core.filter.expression.FilterExpression) AndFilterExpression(com.yahoo.elide.core.filter.expression.AndFilterExpression) HashSet(java.util.HashSet) LinkedHashSet(java.util.LinkedHashSet)

Example 20 with Type

use of com.yahoo.elide.core.type.Type in project elide by yahoo.

the class PersistentResource method createObject.

/**
 * Create a resource in the database.
 *
 * @param parent             - The immediate ancestor in the lineage or null if this is a root.
 * @param parentRelationship - The name of the parent relationship traversed to create this object.
 * @param entityClass        the entity class
 * @param requestScope       the request scope
 * @param uuid               the (optional) uuid
 * @param <T>                object type
 * @return persistent resource
 */
public static <T> PersistentResource<T> createObject(PersistentResource<?> parent, String parentRelationship, Type<T> entityClass, RequestScope requestScope, Optional<String> uuid) {
    T obj = requestScope.getTransaction().createNewObject(entityClass, requestScope);
    String id = uuid.orElse(null);
    PersistentResource<T> newResource = new PersistentResource<>(obj, parent, parentRelationship, id, requestScope);
    // The ID must be assigned before we add it to the new resources set.  Persistent resource
    // hashcode and equals are only based on the ID/UUID & type.
    assignId(newResource, id);
    // Keep track of new resources for non-transferable resources
    requestScope.getNewPersistentResources().add(newResource);
    checkPermission(CreatePermission.class, newResource);
    newResource.auditClass(Audit.Action.CREATE, new ChangeSpec(newResource, null, null, newResource.getObject()));
    requestScope.publishLifecycleEvent(newResource, CREATE);
    requestScope.setUUIDForObject(newResource.type, id, newResource.getObject());
    // Initialize null ToMany collections
    requestScope.getDictionary().getRelationships(entityClass).stream().filter(relationName -> newResource.getRelationshipType(relationName).isToMany() && newResource.getValueUnchecked(relationName) == null).forEach(relationName -> newResource.setValue(relationName, new LinkedHashSet<>()));
    newResource.markDirty();
    return newResource;
}
Also used : Resource(com.yahoo.elide.jsonapi.models.Resource) Data(com.yahoo.elide.jsonapi.models.Data) StringUtils(org.apache.commons.lang3.StringUtils) UpdatePermission(com.yahoo.elide.annotation.UpdatePermission) ClassType(com.yahoo.elide.core.type.ClassType) DeletePermission(com.yahoo.elide.annotation.DeletePermission) Argument(com.yahoo.elide.core.request.Argument) InvalidSyntaxException(com.yahoo.elide.core.audit.InvalidSyntaxException) Map(java.util.Map) DataStoreIterable(com.yahoo.elide.core.datastore.DataStoreIterable) LifeCycleHookBinding(com.yahoo.elide.annotation.LifeCycleHookBinding) EntityBinding(com.yahoo.elide.core.dictionary.EntityBinding) NonNull(lombok.NonNull) Collection(java.util.Collection) Set(java.util.Set) CoerceUtil(com.yahoo.elide.core.utils.coerce.CoerceUtil) Collectors(java.util.stream.Collectors) EntityDictionary(com.yahoo.elide.core.dictionary.EntityDictionary) Sets(com.google.common.collect.Sets) Serializable(java.io.Serializable) Objects(java.util.Objects) ExpressionResult(com.yahoo.elide.core.security.permissions.ExpressionResult) List(java.util.List) Annotation(java.lang.annotation.Annotation) AndFilterExpression(com.yahoo.elide.core.filter.expression.AndFilterExpression) Optional(java.util.Optional) RelationshipType(com.yahoo.elide.core.dictionary.RelationshipType) Attribute(com.yahoo.elide.core.request.Attribute) InvalidAttributeException(com.yahoo.elide.core.exceptions.InvalidAttributeException) Function(java.util.function.Function) Supplier(java.util.function.Supplier) CollectionUtils(org.apache.commons.collections4.CollectionUtils) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) LinkedHashMap(java.util.LinkedHashMap) IterableUtils(org.apache.commons.collections4.IterableUtils) LogMessageImpl(com.yahoo.elide.core.audit.LogMessageImpl) DELETE(com.yahoo.elide.annotation.LifeCycleHookBinding.Operation.DELETE) EntityDictionary.getType(com.yahoo.elide.core.dictionary.EntityDictionary.getType) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore) Predicates(com.google.common.base.Predicates) InternalServerErrorException(com.yahoo.elide.core.exceptions.InternalServerErrorException) CanPaginateVisitor(com.yahoo.elide.core.security.visitors.CanPaginateVisitor) Observable(io.reactivex.Observable) LogMessage(com.yahoo.elide.core.audit.LogMessage) FilterExpression(com.yahoo.elide.core.filter.expression.FilterExpression) LinkedHashSet(java.util.LinkedHashSet) UPDATE(com.yahoo.elide.annotation.LifeCycleHookBinding.Operation.UPDATE) DataStoreTransaction(com.yahoo.elide.core.datastore.DataStoreTransaction) VerifyFieldAccessFilterExpressionVisitor(com.yahoo.elide.core.filter.visitors.VerifyFieldAccessFilterExpressionVisitor) ChangeSpec(com.yahoo.elide.core.security.ChangeSpec) COLLECTION_TYPE(com.yahoo.elide.core.type.ClassType.COLLECTION_TYPE) Sorting(com.yahoo.elide.core.request.Sorting) InvalidEntityBodyException(com.yahoo.elide.core.exceptions.InvalidEntityBodyException) InvalidObjectIdentifierException(com.yahoo.elide.core.exceptions.InvalidObjectIdentifierException) InPredicate(com.yahoo.elide.core.filter.predicates.InPredicate) EntityProjection(com.yahoo.elide.core.request.EntityProjection) Relationship(com.yahoo.elide.jsonapi.models.Relationship) ForbiddenAccessException(com.yahoo.elide.core.exceptions.ForbiddenAccessException) ReadPermission(com.yahoo.elide.annotation.ReadPermission) BadRequestException(com.yahoo.elide.core.exceptions.BadRequestException) Pagination(com.yahoo.elide.core.request.Pagination) ResourceIdentifier(com.yahoo.elide.jsonapi.models.ResourceIdentifier) TreeMap(java.util.TreeMap) CreatePermission(com.yahoo.elide.annotation.CreatePermission) CREATE(com.yahoo.elide.annotation.LifeCycleHookBinding.Operation.CREATE) Type(com.yahoo.elide.core.type.Type) Preconditions(com.google.common.base.Preconditions) Comparator(java.util.Comparator) Collections(java.util.Collections) EMPTY_BINDING(com.yahoo.elide.core.dictionary.EntityBinding.EMPTY_BINDING) Audit(com.yahoo.elide.annotation.Audit) NonTransferable(com.yahoo.elide.annotation.NonTransferable) LinkedHashSet(java.util.LinkedHashSet) ChangeSpec(com.yahoo.elide.core.security.ChangeSpec)

Aggregations

Type (com.yahoo.elide.core.type.Type)35 EntityDictionary (com.yahoo.elide.core.dictionary.EntityDictionary)22 Set (java.util.Set)17 List (java.util.List)16 Map (java.util.Map)16 ClassType (com.yahoo.elide.core.type.ClassType)15 Function (java.util.function.Function)14 FilterExpression (com.yahoo.elide.core.filter.expression.FilterExpression)13 Annotation (java.lang.annotation.Annotation)12 Collectors (java.util.stream.Collectors)12 Collection (java.util.Collection)11 ReadPermission (com.yahoo.elide.annotation.ReadPermission)10 ArrayList (java.util.ArrayList)10 HashSet (java.util.HashSet)10 DataStoreTransaction (com.yahoo.elide.core.datastore.DataStoreTransaction)9 Optional (java.util.Optional)9 RequestScope (com.yahoo.elide.core.RequestScope)8 Objects (java.util.Objects)8 Path (com.yahoo.elide.core.Path)7 RelationshipType (com.yahoo.elide.core.dictionary.RelationshipType)7