Search in sources :

Example 1 with SourcePersistentEntityCriteriaBuilder

use of io.micronaut.data.processor.model.criteria.SourcePersistentEntityCriteriaBuilder in project micronaut-data by micronaut-projects.

the class UpdateMethodMatcher method batchUpdate.

private UpdateCriteriaMethodMatch batchUpdate(java.util.regex.Matcher matcher, ParameterElement idParameter) {
    return new UpdateCriteriaMethodMatch(matcher) {

        @Override
        protected <T> void applyPredicates(String querySequence, ParameterElement[] parameters, PersistentEntityRoot<T> root, PersistentEntityCriteriaUpdate<T> query, SourcePersistentEntityCriteriaBuilder cb) {
            super.applyPredicates(querySequence, parameters, root, query, cb);
            ParameterElement versionParameter = Arrays.stream(parameters).filter(p -> p.hasAnnotation(Version.class)).findFirst().orElse(null);
            Predicate predicate;
            if (versionParameter != null) {
                predicate = cb.and(cb.equal(root.id(), cb.parameter(idParameter)), cb.equal(root.version(), cb.parameter(versionParameter)));
            } else {
                predicate = cb.equal(root.id(), cb.parameter(idParameter));
            }
            query.where(predicate);
        }

        @Override
        protected <T> void applyPredicates(List<ParameterElement> parameters, PersistentEntityRoot<T> root, PersistentEntityCriteriaUpdate<T> query, SourcePersistentEntityCriteriaBuilder cb) {
            ParameterElement versionParameter = parameters.stream().filter(p -> p.hasAnnotation(Version.class)).findFirst().orElse(null);
            Predicate predicate;
            if (versionParameter != null) {
                predicate = cb.and(cb.equal(root.id(), cb.parameter(idParameter)), cb.equal(root.version(), cb.parameter(versionParameter)));
            } else {
                predicate = cb.equal(root.id(), cb.parameter(idParameter));
            }
            query.where(predicate);
        }

        @Override
        protected <T> void addPropertiesToUpdate(MethodMatchContext matchContext, PersistentEntityRoot<T> root, PersistentEntityCriteriaUpdate<T> query, SourcePersistentEntityCriteriaBuilder cb) {
            List<ParameterElement> parameters = matchContext.getParametersNotInRole();
            List<ParameterElement> remainingParameters = parameters.stream().filter(p -> !p.hasAnnotation(Id.class) && !p.hasAnnotation(Version.class)).collect(Collectors.toList());
            ParameterElement idParameter = parameters.stream().filter(p -> p.hasAnnotation(Id.class)).findFirst().orElse(null);
            if (idParameter == null) {
                throw new MatchFailedException("ID required for update method, but not specified");
            }
            SourcePersistentEntity entity = (SourcePersistentEntity) root.getPersistentEntity();
            // Validate @IdClass for composite entity
            if (entity.hasIdentity()) {
                SourcePersistentProperty identity = entity.getIdentity();
                String idType = TypeUtils.getTypeName(identity.getType());
                String idParameterType = TypeUtils.getTypeName(idParameter.getType());
                if (!idType.equals(idParameterType)) {
                    throw new MatchFailedException("ID type of method [" + idParameterType + "] does not match ID type of entity: " + idType);
                }
            } else {
                throw new MatchFailedException("Cannot update by ID for entity that has no ID");
            }
            for (ParameterElement parameter : remainingParameters) {
                String name = getParameterName(parameter);
                SourcePersistentProperty prop = entity.getPropertyByName(name);
                if (prop == null) {
                    throw new MatchFailedException("Cannot update non-existent property: " + name);
                } else {
                    if (prop.isGenerated()) {
                        throw new MatchFailedException("Cannot update a generated property: " + name);
                    } else {
                        query.set(name, cb.parameter(parameter));
                    }
                }
            }
        }
    };
}
Also used : SourcePersistentEntityCriteriaBuilder(io.micronaut.data.processor.model.criteria.SourcePersistentEntityCriteriaBuilder) Arrays(java.util.Arrays) Parameter(io.micronaut.context.annotation.Parameter) MappedEntity(io.micronaut.data.annotation.MappedEntity) ParameterExpression(jakarta.persistence.criteria.ParameterExpression) SourcePersistentProperty(io.micronaut.data.processor.model.SourcePersistentProperty) ClassElement(io.micronaut.inject.ast.ClassElement) Internal(io.micronaut.core.annotation.Internal) AbstractPersistentEntityCriteriaUpdate(io.micronaut.data.model.jpa.criteria.impl.AbstractPersistentEntityCriteriaUpdate) DataInterceptor(io.micronaut.data.intercept.DataInterceptor) ParameterElement(io.micronaut.inject.ast.ParameterElement) Version(io.micronaut.data.annotation.Version) Map(java.util.Map) Id(io.micronaut.data.annotation.Id) PersistentPropertyPath(io.micronaut.data.model.PersistentPropertyPath) UpdateCriteriaMethodMatch(io.micronaut.data.processor.visitors.finders.criteria.UpdateCriteriaMethodMatch) MatchFailedException(io.micronaut.data.processor.visitors.MatchFailedException) Predicate(jakarta.persistence.criteria.Predicate) AutoPopulated(io.micronaut.data.annotation.AutoPopulated) Set(java.util.Set) SourcePersistentEntity(io.micronaut.data.processor.model.SourcePersistentEntity) Collectors(java.util.stream.Collectors) PersistentEntityCriteriaUpdate(io.micronaut.data.model.jpa.criteria.PersistentEntityCriteriaUpdate) PersistentEntityRoot(io.micronaut.data.model.jpa.criteria.PersistentEntityRoot) List(java.util.List) Association(io.micronaut.data.model.Association) Stream(java.util.stream.Stream) MethodMatchContext(io.micronaut.data.processor.visitors.MethodMatchContext) MethodElement(io.micronaut.inject.ast.MethodElement) MatchFailedException(io.micronaut.data.processor.visitors.MatchFailedException) SourcePersistentEntity(io.micronaut.data.processor.model.SourcePersistentEntity) Predicate(jakarta.persistence.criteria.Predicate) SourcePersistentEntityCriteriaBuilder(io.micronaut.data.processor.model.criteria.SourcePersistentEntityCriteriaBuilder) MethodMatchContext(io.micronaut.data.processor.visitors.MethodMatchContext) PersistentEntityRoot(io.micronaut.data.model.jpa.criteria.PersistentEntityRoot) SourcePersistentProperty(io.micronaut.data.processor.model.SourcePersistentProperty) AbstractPersistentEntityCriteriaUpdate(io.micronaut.data.model.jpa.criteria.impl.AbstractPersistentEntityCriteriaUpdate) PersistentEntityCriteriaUpdate(io.micronaut.data.model.jpa.criteria.PersistentEntityCriteriaUpdate) Version(io.micronaut.data.annotation.Version) UpdateCriteriaMethodMatch(io.micronaut.data.processor.visitors.finders.criteria.UpdateCriteriaMethodMatch) List(java.util.List) ParameterElement(io.micronaut.inject.ast.ParameterElement) Id(io.micronaut.data.annotation.Id)

Example 2 with SourcePersistentEntityCriteriaBuilder

use of io.micronaut.data.processor.model.criteria.SourcePersistentEntityCriteriaBuilder in project micronaut-data by micronaut-projects.

the class UpdateMethodMatcher method batchUpdate2.

private UpdateCriteriaMethodMatch batchUpdate2(java.util.regex.Matcher matcher) {
    return new UpdateCriteriaMethodMatch(matcher) {

        @Override
        protected <T> void addPropertiesToUpdate(MethodMatchContext matchContext, PersistentEntityRoot<T> root, PersistentEntityCriteriaUpdate<T> query, SourcePersistentEntityCriteriaBuilder cb) {
            Set<String> queryParameters = query.getParameters().stream().map(ParameterExpression::getName).collect(Collectors.toSet());
            for (ParameterElement p : matchContext.getParametersNotInRole()) {
                String parameterName = getParameterName(p);
                if (queryParameters.contains(parameterName)) {
                    continue;
                }
                PersistentPropertyPath path = root.getPersistentEntity().getPropertyPath(parameterName);
                if (path != null) {
                    query.set(path.getProperty().getName(), cb.parameter(p));
                } else {
                    throw new MatchFailedException("Cannot perform batch update for non-existent property: " + parameterName);
                }
            }
        }
    };
}
Also used : SourcePersistentEntityCriteriaBuilder(io.micronaut.data.processor.model.criteria.SourcePersistentEntityCriteriaBuilder) MethodMatchContext(io.micronaut.data.processor.visitors.MethodMatchContext) MatchFailedException(io.micronaut.data.processor.visitors.MatchFailedException) PersistentEntityRoot(io.micronaut.data.model.jpa.criteria.PersistentEntityRoot) AbstractPersistentEntityCriteriaUpdate(io.micronaut.data.model.jpa.criteria.impl.AbstractPersistentEntityCriteriaUpdate) PersistentEntityCriteriaUpdate(io.micronaut.data.model.jpa.criteria.PersistentEntityCriteriaUpdate) UpdateCriteriaMethodMatch(io.micronaut.data.processor.visitors.finders.criteria.UpdateCriteriaMethodMatch) ParameterElement(io.micronaut.inject.ast.ParameterElement) PersistentPropertyPath(io.micronaut.data.model.PersistentPropertyPath)

Example 3 with SourcePersistentEntityCriteriaBuilder

use of io.micronaut.data.processor.model.criteria.SourcePersistentEntityCriteriaBuilder in project micronaut-data by micronaut-projects.

the class UpdateMethodMatcher method entityUpdate.

private UpdateCriteriaMethodMatch entityUpdate(java.util.regex.Matcher matcher, ParameterElement entityParameter, ParameterElement entitiesParameter) {
    return new UpdateCriteriaMethodMatch(matcher) {

        ParameterElement entityParam = entityParameter == null ? entitiesParameter : entityParameter;

        @Override
        protected <T> void applyPredicates(List<ParameterElement> parameters, PersistentEntityRoot<T> root, PersistentEntityCriteriaUpdate<T> query, SourcePersistentEntityCriteriaBuilder cb) {
            final SourcePersistentEntity rootEntity = (SourcePersistentEntity) root.getPersistentEntity();
            Predicate predicate;
            if (rootEntity.getVersion() != null) {
                predicate = cb.and(cb.equal(root.id(), cb.entityPropertyParameter(entityParam)), cb.equal(root.version(), cb.entityPropertyParameter(entityParam)));
            } else {
                predicate = cb.equal(root.id(), cb.entityPropertyParameter(entityParam));
            }
            query.where(predicate);
        }

        @Override
        protected <T> void addPropertiesToUpdate(MethodMatchContext matchContext, PersistentEntityRoot<T> root, PersistentEntityCriteriaUpdate<T> query, SourcePersistentEntityCriteriaBuilder cb) {
            final SourcePersistentEntity rootEntity = matchContext.getRootEntity();
            Stream.concat(rootEntity.getPersistentProperties().stream(), Stream.of(rootEntity.getVersion())).filter(p -> p != null && !((p instanceof Association) && ((Association) p).isForeignKey()) && !p.isGenerated() && p.findAnnotation(AutoPopulated.class).map(ap -> ap.getRequiredValue(AutoPopulated.UPDATEABLE, Boolean.class)).orElse(true)).forEach(p -> query.set(p.getName(), cb.entityPropertyParameter(entityParam)));
            if (((AbstractPersistentEntityCriteriaUpdate<T>) query).getUpdateValues().isEmpty()) {
                // Workaround for only ID entities
                query.set(rootEntity.getIdentity().getName(), cb.entityPropertyParameter(entityParam));
            }
        }

        @Override
        protected boolean supportedByImplicitQueries() {
            return true;
        }

        @Override
        protected Map.Entry<ClassElement, Class<? extends DataInterceptor>> resolveReturnTypeAndInterceptor(MethodMatchContext matchContext) {
            Map.Entry<ClassElement, Class<? extends DataInterceptor>> e = super.resolveReturnTypeAndInterceptor(matchContext);
            ClassElement returnType = e.getKey();
            if (returnType != null && !TypeUtils.isVoid(returnType) && !TypeUtils.isNumber(returnType) && !returnType.hasStereotype(MappedEntity.class) && !(TypeUtils.isReactiveOrFuture(matchContext.getReturnType()) && TypeUtils.isObjectClass(returnType))) {
                throw new MatchFailedException("Cannot implement update method for specified return type: " + returnType.getName());
            }
            return e;
        }

        @Override
        protected ParameterElement getEntityParameter() {
            return entityParameter;
        }

        @Override
        protected ParameterElement getEntitiesParameter() {
            return entitiesParameter;
        }
    };
}
Also used : SourcePersistentEntityCriteriaBuilder(io.micronaut.data.processor.model.criteria.SourcePersistentEntityCriteriaBuilder) Arrays(java.util.Arrays) Parameter(io.micronaut.context.annotation.Parameter) MappedEntity(io.micronaut.data.annotation.MappedEntity) ParameterExpression(jakarta.persistence.criteria.ParameterExpression) SourcePersistentProperty(io.micronaut.data.processor.model.SourcePersistentProperty) ClassElement(io.micronaut.inject.ast.ClassElement) Internal(io.micronaut.core.annotation.Internal) AbstractPersistentEntityCriteriaUpdate(io.micronaut.data.model.jpa.criteria.impl.AbstractPersistentEntityCriteriaUpdate) DataInterceptor(io.micronaut.data.intercept.DataInterceptor) ParameterElement(io.micronaut.inject.ast.ParameterElement) Version(io.micronaut.data.annotation.Version) Map(java.util.Map) Id(io.micronaut.data.annotation.Id) PersistentPropertyPath(io.micronaut.data.model.PersistentPropertyPath) UpdateCriteriaMethodMatch(io.micronaut.data.processor.visitors.finders.criteria.UpdateCriteriaMethodMatch) MatchFailedException(io.micronaut.data.processor.visitors.MatchFailedException) Predicate(jakarta.persistence.criteria.Predicate) AutoPopulated(io.micronaut.data.annotation.AutoPopulated) Set(java.util.Set) SourcePersistentEntity(io.micronaut.data.processor.model.SourcePersistentEntity) Collectors(java.util.stream.Collectors) PersistentEntityCriteriaUpdate(io.micronaut.data.model.jpa.criteria.PersistentEntityCriteriaUpdate) PersistentEntityRoot(io.micronaut.data.model.jpa.criteria.PersistentEntityRoot) List(java.util.List) Association(io.micronaut.data.model.Association) Stream(java.util.stream.Stream) MethodMatchContext(io.micronaut.data.processor.visitors.MethodMatchContext) MethodElement(io.micronaut.inject.ast.MethodElement) DataInterceptor(io.micronaut.data.intercept.DataInterceptor) MatchFailedException(io.micronaut.data.processor.visitors.MatchFailedException) SourcePersistentEntity(io.micronaut.data.processor.model.SourcePersistentEntity) MappedEntity(io.micronaut.data.annotation.MappedEntity) ClassElement(io.micronaut.inject.ast.ClassElement) Predicate(jakarta.persistence.criteria.Predicate) SourcePersistentEntityCriteriaBuilder(io.micronaut.data.processor.model.criteria.SourcePersistentEntityCriteriaBuilder) MethodMatchContext(io.micronaut.data.processor.visitors.MethodMatchContext) Association(io.micronaut.data.model.Association) PersistentEntityRoot(io.micronaut.data.model.jpa.criteria.PersistentEntityRoot) AbstractPersistentEntityCriteriaUpdate(io.micronaut.data.model.jpa.criteria.impl.AbstractPersistentEntityCriteriaUpdate) PersistentEntityCriteriaUpdate(io.micronaut.data.model.jpa.criteria.PersistentEntityCriteriaUpdate) UpdateCriteriaMethodMatch(io.micronaut.data.processor.visitors.finders.criteria.UpdateCriteriaMethodMatch) List(java.util.List) ParameterElement(io.micronaut.inject.ast.ParameterElement) Map(java.util.Map) AutoPopulated(io.micronaut.data.annotation.AutoPopulated)

Example 4 with SourcePersistentEntityCriteriaBuilder

use of io.micronaut.data.processor.model.criteria.SourcePersistentEntityCriteriaBuilder in project micronaut-data by micronaut-projects.

the class UpdateCriteriaMethodMatch method apply.

/**
 * Apply query match.
 *
 * @param matchContext The match context
 * @param root         The root
 * @param query        The query
 * @param cb           The criteria builder
 * @param <T>          The entity type
 */
protected <T> void apply(MethodMatchContext matchContext, PersistentEntityRoot<T> root, PersistentEntityCriteriaUpdate<T> query, SourcePersistentEntityCriteriaBuilder cb) {
    String querySequence = matcher.group(3);
    if (matcher.group(2).endsWith("By")) {
        applyPredicates(querySequence, matchContext.getParameters(), root, query, cb);
    } else {
        applyPredicates(matchContext.getParametersNotInRole(), root, query, cb);
    }
    if (query.getRestriction() == null) {
        throw new MatchFailedException("Cannot implement batch update operation that doesn't perform a query");
    }
    SourcePersistentEntity entity = matchContext.getRootEntity();
    addPropertiesToUpdate(matchContext, root, query, cb);
    // Add updatable auto-populated parameters
    entity.getPersistentProperties().stream().filter(p -> p != null && p.findAnnotation(AutoPopulated.class).map(ap -> ap.getRequiredValue(AutoPopulated.UPDATEABLE, Boolean.class)).orElse(false)).forEach(p -> query.set(p.getName(), cb.parameter((ParameterElement) null)));
    if (entity.getVersion() != null) {
        if (((AbstractPersistentEntityCriteriaUpdate<T>) query).hasVersionRestriction()) {
            query.set(entity.getVersion().getName(), cb.parameter((ParameterElement) null));
        }
    }
    if (((AbstractPersistentEntityCriteriaUpdate<T>) query).getUpdateValues().isEmpty()) {
        throw new MatchFailedException("At least one parameter required to update");
    }
}
Also used : SourcePersistentEntityCriteriaBuilder(io.micronaut.data.processor.model.criteria.SourcePersistentEntityCriteriaBuilder) MatchFailedException(io.micronaut.data.processor.visitors.MatchFailedException) AbstractCriteriaMethodMatch(io.micronaut.data.processor.visitors.finders.AbstractCriteriaMethodMatch) QueryModel(io.micronaut.data.model.query.QueryModel) AutoPopulated(io.micronaut.data.annotation.AutoPopulated) ClassElement(io.micronaut.inject.ast.ClassElement) SourcePersistentEntity(io.micronaut.data.processor.model.SourcePersistentEntity) AbstractPersistentEntityCriteriaUpdate(io.micronaut.data.model.jpa.criteria.impl.AbstractPersistentEntityCriteriaUpdate) DataInterceptor(io.micronaut.data.intercept.DataInterceptor) PersistentEntityCriteriaUpdate(io.micronaut.data.model.jpa.criteria.PersistentEntityCriteriaUpdate) ParameterElement(io.micronaut.inject.ast.ParameterElement) DataMethod(io.micronaut.data.intercept.annotation.DataMethod) PersistentEntityRoot(io.micronaut.data.model.jpa.criteria.PersistentEntityRoot) Matcher(java.util.regex.Matcher) MethodMatchContext(io.micronaut.data.processor.visitors.MethodMatchContext) Map(java.util.Map) QueryBuilder(io.micronaut.data.model.query.builder.QueryBuilder) QueryResult(io.micronaut.data.model.query.builder.QueryResult) MethodMatchSourcePersistentEntityCriteriaBuilderImpl(io.micronaut.data.processor.model.criteria.impl.MethodMatchSourcePersistentEntityCriteriaBuilderImpl) AnnotationMetadataHierarchy(io.micronaut.data.processor.visitors.AnnotationMetadataHierarchy) Experimental(io.micronaut.core.annotation.Experimental) MethodMatchInfo(io.micronaut.data.processor.visitors.finders.MethodMatchInfo) AbstractPersistentEntityCriteriaUpdate(io.micronaut.data.model.jpa.criteria.impl.AbstractPersistentEntityCriteriaUpdate) MatchFailedException(io.micronaut.data.processor.visitors.MatchFailedException) SourcePersistentEntity(io.micronaut.data.processor.model.SourcePersistentEntity) ParameterElement(io.micronaut.inject.ast.ParameterElement) AutoPopulated(io.micronaut.data.annotation.AutoPopulated)

Example 5 with SourcePersistentEntityCriteriaBuilder

use of io.micronaut.data.processor.model.criteria.SourcePersistentEntityCriteriaBuilder in project micronaut-data by micronaut-projects.

the class DeleteMethodMatcher method match.

@Override
public MethodMatch match(MethodMatchContext matchContext, java.util.regex.Matcher matcher) {
    ParameterElement[] parameters = matchContext.getParameters();
    boolean isSpecificDelete = matcher.group(2).endsWith("By");
    ParameterElement entityParameter = null;
    ParameterElement entitiesParameter = null;
    if (matchContext.getParametersNotInRole().size() == 1) {
        entityParameter = Arrays.stream(parameters).filter(p -> TypeUtils.isEntity(p.getGenericType())).findFirst().orElse(null);
        entitiesParameter = Arrays.stream(parameters).filter(p -> TypeUtils.isIterableOfEntity(p.getGenericType())).findFirst().orElse(null);
    }
    if (isSpecificDelete) {
        // Un-mark the entity parameter if there is a property named the same and 'By' syntax is used
        if (entityParameter != null) {
            if (matchContext.getRootEntity().getPropertyByName(getName(entityParameter)) != null) {
                entityParameter = null;
            }
        }
        if (entitiesParameter != null) {
            if (matchContext.getRootEntity().getPropertyByName(getName(entitiesParameter)) != null) {
                entitiesParameter = null;
            }
        }
    }
    if (entityParameter == null && entitiesParameter == null) {
        if (!TypeUtils.isValidBatchUpdateReturnType(matchContext.getMethodElement())) {
            return null;
        }
        return new DeleteCriteriaMethodMatch(matcher);
    }
    SourcePersistentEntity rootEntity = matchContext.getRootEntity();
    if (!rootEntity.hasIdentity() && !rootEntity.hasCompositeIdentity()) {
        throw new MatchFailedException("Delete all not supported for entities with no ID");
    }
    boolean supportedByImplicitQueries = !matcher.group(2).endsWith("By");
    boolean generateInIdList = entitiesParameter != null && !rootEntity.hasCompositeIdentity() && !(rootEntity.getIdentity() instanceof Embedded) && rootEntity.getVersion() == null;
    ParameterElement finalEntityParameter = entityParameter;
    ParameterElement finalEntitiesParameter = entitiesParameter;
    if (generateInIdList) {
        return new DeleteCriteriaMethodMatch(matcher) {

            @Override
            protected boolean supportedByImplicitQueries() {
                return supportedByImplicitQueries;
            }

            @Override
            protected <T> void applyPredicates(List<ParameterElement> parameters, PersistentEntityRoot<T> root, PersistentEntityCriteriaDelete<T> query, SourcePersistentEntityCriteriaBuilder cb) {
                Predicate restriction = query.getRestriction();
                Predicate predicate = root.id().in(cb.entityPropertyParameter(finalEntitiesParameter));
                if (restriction == null) {
                    query.where(predicate);
                } else {
                    query.where(cb.and(predicate, restriction));
                }
            }

            @Override
            protected ParameterElement getEntityParameter() {
                return finalEntityParameter;
            }

            @Override
            protected ParameterElement getEntitiesParameter() {
                return finalEntitiesParameter;
            }
        };
    }
    ParameterElement entityParam = entityParameter == null ? entitiesParameter : entityParameter;
    return new DeleteCriteriaMethodMatch(matcher) {

        @Override
        protected boolean supportedByImplicitQueries() {
            return supportedByImplicitQueries;
        }

        @Override
        protected <T> void applyPredicates(List<ParameterElement> parameters, PersistentEntityRoot<T> root, PersistentEntityCriteriaDelete<T> query, SourcePersistentEntityCriteriaBuilder cb) {
            Predicate restriction = query.getRestriction();
            Predicate predicate;
            if (rootEntity.getVersion() != null) {
                predicate = cb.and(cb.equal(root.id(), cb.entityPropertyParameter(entityParam)), cb.equal(root.version(), cb.entityPropertyParameter(entityParam)));
            } else {
                predicate = cb.equal(root.id(), cb.entityPropertyParameter(entityParam));
            }
            if (restriction == null) {
                query.where(predicate);
            } else {
                query.where(cb.and(predicate, restriction));
            }
        }

        @Override
        protected ParameterElement getEntityParameter() {
            return finalEntityParameter;
        }

        @Override
        protected ParameterElement getEntitiesParameter() {
            return finalEntitiesParameter;
        }
    };
}
Also used : SourcePersistentEntityCriteriaBuilder(io.micronaut.data.processor.model.criteria.SourcePersistentEntityCriteriaBuilder) Arrays(java.util.Arrays) Parameter(io.micronaut.context.annotation.Parameter) MatchFailedException(io.micronaut.data.processor.visitors.MatchFailedException) DeleteCriteriaMethodMatch(io.micronaut.data.processor.visitors.finders.criteria.DeleteCriteriaMethodMatch) Predicate(jakarta.persistence.criteria.Predicate) Internal(io.micronaut.core.annotation.Internal) SourcePersistentEntity(io.micronaut.data.processor.model.SourcePersistentEntity) ParameterElement(io.micronaut.inject.ast.ParameterElement) PersistentEntityRoot(io.micronaut.data.model.jpa.criteria.PersistentEntityRoot) Embedded(io.micronaut.data.model.Embedded) List(java.util.List) MethodMatchContext(io.micronaut.data.processor.visitors.MethodMatchContext) PersistentEntityCriteriaDelete(io.micronaut.data.model.jpa.criteria.PersistentEntityCriteriaDelete) Pattern(java.util.regex.Pattern) MatchFailedException(io.micronaut.data.processor.visitors.MatchFailedException) SourcePersistentEntity(io.micronaut.data.processor.model.SourcePersistentEntity) Predicate(jakarta.persistence.criteria.Predicate) SourcePersistentEntityCriteriaBuilder(io.micronaut.data.processor.model.criteria.SourcePersistentEntityCriteriaBuilder) PersistentEntityRoot(io.micronaut.data.model.jpa.criteria.PersistentEntityRoot) PersistentEntityCriteriaDelete(io.micronaut.data.model.jpa.criteria.PersistentEntityCriteriaDelete) List(java.util.List) ParameterElement(io.micronaut.inject.ast.ParameterElement) DeleteCriteriaMethodMatch(io.micronaut.data.processor.visitors.finders.criteria.DeleteCriteriaMethodMatch) Embedded(io.micronaut.data.model.Embedded)

Aggregations

PersistentEntityRoot (io.micronaut.data.model.jpa.criteria.PersistentEntityRoot)6 SourcePersistentEntityCriteriaBuilder (io.micronaut.data.processor.model.criteria.SourcePersistentEntityCriteriaBuilder)6 MethodMatchContext (io.micronaut.data.processor.visitors.MethodMatchContext)6 MatchFailedException (io.micronaut.data.processor.visitors.MatchFailedException)5 ParameterElement (io.micronaut.inject.ast.ParameterElement)5 DataInterceptor (io.micronaut.data.intercept.DataInterceptor)4 PersistentEntityCriteriaUpdate (io.micronaut.data.model.jpa.criteria.PersistentEntityCriteriaUpdate)4 AbstractPersistentEntityCriteriaUpdate (io.micronaut.data.model.jpa.criteria.impl.AbstractPersistentEntityCriteriaUpdate)4 SourcePersistentEntity (io.micronaut.data.processor.model.SourcePersistentEntity)4 ClassElement (io.micronaut.inject.ast.ClassElement)4 Map (java.util.Map)4 Parameter (io.micronaut.context.annotation.Parameter)3 Internal (io.micronaut.core.annotation.Internal)3 AutoPopulated (io.micronaut.data.annotation.AutoPopulated)3 PersistentPropertyPath (io.micronaut.data.model.PersistentPropertyPath)3 UpdateCriteriaMethodMatch (io.micronaut.data.processor.visitors.finders.criteria.UpdateCriteriaMethodMatch)3 Predicate (jakarta.persistence.criteria.Predicate)3 Arrays (java.util.Arrays)3 List (java.util.List)3 Id (io.micronaut.data.annotation.Id)2