Search in sources :

Example 6 with PreparedQuery

use of io.micronaut.data.model.runtime.PreparedQuery in project micronaut-coherence by micronaut-projects.

the class DefaultCoherenceRepositoryOperations method createBindingMap.

/**
 * Creates a map of binding parameters names and their values.
 *
 * @param preparedQuery the {@link PreparedQuery} to build the binding map from
 *
 * @return the parameters necessary to execute a CohQL statement
 */
protected Map<String, Object> createBindingMap(PreparedQuery preparedQuery) {
    List<QueryParameterBinding> bindings = preparedQuery.getQueryBindings();
    int bindingsLen = bindings.size();
    String[] bindingNames = new String[bindingsLen];
    Integer[] bindingIndexes = new Integer[bindingsLen];
    for (int i = 0; i < bindingsLen; i++) {
        QueryParameterBinding binding = bindings.get(i);
        bindingNames[i] = binding.getName();
        bindingIndexes[i] = binding.getParameterIndex();
    }
    Object[] bindingValues = preparedQuery.getParameterArray();
    return IntStream.range(0, bindingNames.length).boxed().collect(Collectors.toMap(i -> bindingNames[i], i -> bindingValues[bindingIndexes[i]]));
}
Also used : IntStream(java.util.stream.IntStream) Coherence(com.tangosol.net.Coherence) QueryParameterBinding(io.micronaut.data.model.runtime.QueryParameterBinding) Parameter(io.micronaut.context.annotation.Parameter) RemoveEventSource(io.micronaut.coherence.data.annotation.RemoveEventSource) BeanContext(io.micronaut.context.BeanContext) BeanProperty(io.micronaut.core.beans.BeanProperty) QueryHelper(com.tangosol.util.QueryHelper) UpdateEventSource(io.micronaut.coherence.data.annotation.UpdateEventSource) HashMap(java.util.HashMap) Session(com.tangosol.net.Session) ConcurrentMap(java.util.concurrent.ConcurrentMap) LinkedHashMap(java.util.LinkedHashMap) ApplicationContext(io.micronaut.context.ApplicationContext) Logger(com.oracle.coherence.common.base.Logger) Nullable(io.micronaut.core.annotation.Nullable) Map(java.util.Map) Page(io.micronaut.data.model.Page) ArgumentUtils(io.micronaut.core.util.ArgumentUtils) DeleteOperation(io.micronaut.data.model.runtime.DeleteOperation) NamedMap(com.tangosol.net.NamedMap) PrintWriter(java.io.PrintWriter) PagedQuery(io.micronaut.data.model.runtime.PagedQuery) ExecutionContext(com.tangosol.coherence.dslquery.ExecutionContext) RuntimePersistentProperty(io.micronaut.data.model.runtime.RuntimePersistentProperty) Processors(com.tangosol.util.Processors) StringWriter(java.io.StringWriter) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) Set(java.util.Set) Statement(com.tangosol.coherence.dslquery.Statement) IOException(java.io.IOException) InsertBatchOperation(io.micronaut.data.model.runtime.InsertBatchOperation) Collectors(java.util.stream.Collectors) PreparedQuery(io.micronaut.data.model.runtime.PreparedQuery) Serializable(java.io.Serializable) PersistEventSource(io.micronaut.coherence.data.annotation.PersistEventSource) NonNull(io.micronaut.core.annotation.NonNull) List(java.util.List) Stream(java.util.stream.Stream) DeleteBatchOperation(io.micronaut.data.model.runtime.DeleteBatchOperation) InsertOperation(io.micronaut.data.model.runtime.InsertOperation) Optional(java.util.Optional) EachProperty(io.micronaut.context.annotation.EachProperty) RuntimePersistentEntity(io.micronaut.data.model.runtime.RuntimePersistentEntity) AsyncRepositoryOperations(io.micronaut.data.operations.async.AsyncRepositoryOperations) UpdateOperation(io.micronaut.data.model.runtime.UpdateOperation) Collections(java.util.Collections) QueryParameterBinding(io.micronaut.data.model.runtime.QueryParameterBinding)

Example 7 with PreparedQuery

use of io.micronaut.data.model.runtime.PreparedQuery in project micronaut-data by micronaut-projects.

the class HibernateJpaOperations method findAll.

@NonNull
@Override
public <T, R> Iterable<R> findAll(@NonNull PreparedQuery<T, R> preparedQuery) {
    return transactionOperations.executeRead(status -> {
        Session entityManager = sessionFactory.getCurrentSession();
        String queryStr = preparedQuery.getQuery();
        Pageable pageable = preparedQuery.getPageable();
        if (pageable != Pageable.UNPAGED) {
            Sort sort = pageable.getSort();
            if (sort.isSorted()) {
                queryStr += QUERY_BUILDER.buildOrderBy(queryStr, getEntity(preparedQuery.getRootEntity()), sort).getQuery();
            }
        }
        if (preparedQuery.isDtoProjection()) {
            Query<Tuple> q;
            if (preparedQuery.isNative()) {
                q = entityManager.createNativeQuery(queryStr, Tuple.class);
            } else if (queryStr.toLowerCase(Locale.ENGLISH).startsWith("select new ")) {
                Class<R> wrapperType = ReflectionUtils.getWrapperType(preparedQuery.getResultType());
                Query<R> query = entityManager.createQuery(queryStr, wrapperType);
                bindPreparedQuery(query, preparedQuery, entityManager, queryStr);
                return query.list();
            } else {
                q = entityManager.createQuery(queryStr, Tuple.class);
            }
            bindPreparedQuery(q, preparedQuery, entityManager, queryStr);
            return q.stream().map(tuple -> {
                Set<String> properties = tuple.getElements().stream().map(TupleElement::getAlias).collect(Collectors.toCollection(() -> new TreeSet<>(String.CASE_INSENSITIVE_ORDER)));
                return (new BeanIntrospectionMapper<Tuple, R>() {

                    @Override
                    public Object read(Tuple tuple1, String alias) {
                        if (!properties.contains(alias)) {
                            return null;
                        }
                        return tuple1.get(alias);
                    }

                    @Override
                    public ConversionService<?> getConversionService() {
                        return dataConversionService;
                    }
                }).map(tuple, preparedQuery.getResultType());
            }).collect(Collectors.toList());
        } else {
            Class<R> wrapperType = ReflectionUtils.getWrapperType(preparedQuery.getResultType());
            Query<R> q;
            if (preparedQuery.isNative()) {
                if (DataType.ENTITY.equals(preparedQuery.getResultDataType())) {
                    q = entityManager.createNativeQuery(queryStr, wrapperType);
                } else {
                    q = entityManager.createNativeQuery(queryStr);
                }
            } else {
                q = entityManager.createQuery(queryStr, wrapperType);
            }
            bindPreparedQuery(q, preparedQuery, entityManager, queryStr);
            return q.list();
        }
    });
}
Also used : DataType(io.micronaut.data.model.DataType) Connection(java.sql.Connection) ArrayUtils(io.micronaut.core.util.ArrayUtils) ExecutorReactiveOperations(io.micronaut.data.runtime.operations.ExecutorReactiveOperations) SubGraph(org.hibernate.graph.SubGraph) EachBean(io.micronaut.context.annotation.EachBean) StoredQuery(io.micronaut.data.model.runtime.StoredQuery) Locale(java.util.Locale) Map(java.util.Map) Query(org.hibernate.query.Query) CriteriaBuilder(javax.persistence.criteria.CriteriaBuilder) ArgumentUtils(io.micronaut.core.util.ArgumentUtils) DeleteOperation(io.micronaut.data.model.runtime.DeleteOperation) TypeHint(io.micronaut.core.annotation.TypeHint) AsyncCapableRepository(io.micronaut.data.operations.async.AsyncCapableRepository) Path(javax.persistence.criteria.Path) PersistentPropertyPath(io.micronaut.data.model.PersistentPropertyPath) JpaRepositoryOperations(io.micronaut.data.jpa.operations.JpaRepositoryOperations) CriteriaQuery(javax.persistence.criteria.CriteriaQuery) IntrospectionException(io.micronaut.core.beans.exceptions.IntrospectionException) Graph(org.hibernate.graph.Graph) Sort(io.micronaut.data.model.Sort) RuntimePersistentProperty(io.micronaut.data.model.runtime.RuntimePersistentProperty) Collection(java.util.Collection) SessionFactory(org.hibernate.SessionFactory) Set(java.util.Set) Collectors(java.util.stream.Collectors) Executors(java.util.concurrent.Executors) QueryHint(io.micronaut.data.annotation.QueryHint) PreparedQuery(io.micronaut.data.model.runtime.PreparedQuery) Serializable(java.io.Serializable) Objects(java.util.Objects) List(java.util.List) Stream(java.util.stream.Stream) EntityManagerFactory(javax.persistence.EntityManagerFactory) Order(javax.persistence.criteria.Order) Optional(java.util.Optional) TupleElement(javax.persistence.TupleElement) Named(jakarta.inject.Named) JpaQueryBuilder(io.micronaut.data.model.query.builder.jpa.JpaQueryBuilder) QueryParameterBinding(io.micronaut.data.model.runtime.QueryParameterBinding) AttributeNode(org.hibernate.graph.AttributeNode) RootGraph(org.hibernate.graph.RootGraph) Parameter(io.micronaut.context.annotation.Parameter) TransactionOperations(io.micronaut.transaction.TransactionOperations) Creator(io.micronaut.core.annotation.Creator) BeanProperty(io.micronaut.core.beans.BeanProperty) Session(org.hibernate.Session) FlushModeType(javax.persistence.FlushModeType) RuntimeEntityRegistry(io.micronaut.data.model.runtime.RuntimeEntityRegistry) HibernatePresenceCondition(io.micronaut.jdbc.spring.HibernatePresenceCondition) TreeSet(java.util.TreeSet) ArrayList(java.util.ArrayList) ApplicationContext(io.micronaut.context.ApplicationContext) Nullable(io.micronaut.core.annotation.Nullable) NativeQuery(org.hibernate.query.NativeQuery) Page(io.micronaut.data.model.Page) Pageable(io.micronaut.data.model.Pageable) ReactiveCapableRepository(io.micronaut.data.operations.reactive.ReactiveCapableRepository) ExecutorAsyncOperations(io.micronaut.data.runtime.operations.ExecutorAsyncOperations) Argument(io.micronaut.core.type.Argument) Expression(javax.persistence.criteria.Expression) ConversionService(io.micronaut.core.convert.ConversionService) BeanWrapper(io.micronaut.core.beans.BeanWrapper) ReactiveRepositoryOperations(io.micronaut.data.operations.reactive.ReactiveRepositoryOperations) Root(javax.persistence.criteria.Root) ExecutorService(java.util.concurrent.ExecutorService) Tuple(javax.persistence.Tuple) PagedQuery(io.micronaut.data.model.runtime.PagedQuery) Iterator(java.util.Iterator) DataConversionService(io.micronaut.data.runtime.convert.DataConversionService) EntityManager(javax.persistence.EntityManager) InsertBatchOperation(io.micronaut.data.model.runtime.InsertBatchOperation) ReflectionUtils(io.micronaut.core.reflect.ReflectionUtils) NonNull(io.micronaut.core.annotation.NonNull) CollectionUtils(io.micronaut.core.util.CollectionUtils) BeanIntrospection(io.micronaut.core.beans.BeanIntrospection) DeleteBatchOperation(io.micronaut.data.model.runtime.DeleteBatchOperation) InsertOperation(io.micronaut.data.model.runtime.InsertOperation) AnnotationMetadata(io.micronaut.core.annotation.AnnotationMetadata) EntityGraph(io.micronaut.data.jpa.annotation.EntityGraph) BeanIntrospectionMapper(io.micronaut.data.runtime.mapper.BeanIntrospectionMapper) RuntimePersistentEntity(io.micronaut.data.model.runtime.RuntimePersistentEntity) UpdateBatchOperation(io.micronaut.data.model.runtime.UpdateBatchOperation) UpdateOperation(io.micronaut.data.model.runtime.UpdateOperation) Collections(java.util.Collections) Type(org.hibernate.type.Type) Set(java.util.Set) TreeSet(java.util.TreeSet) StoredQuery(io.micronaut.data.model.runtime.StoredQuery) Query(org.hibernate.query.Query) CriteriaQuery(javax.persistence.criteria.CriteriaQuery) PreparedQuery(io.micronaut.data.model.runtime.PreparedQuery) NativeQuery(org.hibernate.query.NativeQuery) PagedQuery(io.micronaut.data.model.runtime.PagedQuery) Pageable(io.micronaut.data.model.Pageable) TupleElement(javax.persistence.TupleElement) ConversionService(io.micronaut.core.convert.ConversionService) DataConversionService(io.micronaut.data.runtime.convert.DataConversionService) Sort(io.micronaut.data.model.Sort) Tuple(javax.persistence.Tuple) Session(org.hibernate.Session) NonNull(io.micronaut.core.annotation.NonNull)

Example 8 with PreparedQuery

use of io.micronaut.data.model.runtime.PreparedQuery in project micronaut-data by micronaut-projects.

the class DefaultFindSliceReactiveInterceptor method intercept.

@Override
public Object intercept(RepositoryMethodKey methodKey, MethodInvocationContext<Object, Object> context) {
    if (context.hasAnnotation(Query.class)) {
        PreparedQuery<Object, Object> preparedQuery = (PreparedQuery<Object, Object>) prepareQuery(methodKey, context);
        Pageable pageable = preparedQuery.getPageable();
        Mono<Slice<Object>> publisher = Flux.from(reactiveOperations.findAll(preparedQuery)).collectList().map(objects -> Slice.of(objects, pageable));
        return Publishers.convertPublisher(publisher, context.getReturnType().getType());
    } else {
        PagedQuery<Object> pagedQuery = getPagedQuery(context);
        Mono<? extends Slice<?>> result = Flux.from(reactiveOperations.findAll(pagedQuery)).collectList().map(objects -> Slice.of(objects, pagedQuery.getPageable()));
        return Publishers.convertPublisher(result, context.getReturnType().getType());
    }
}
Also used : Pageable(io.micronaut.data.model.Pageable) Slice(io.micronaut.data.model.Slice) PreparedQuery(io.micronaut.data.model.runtime.PreparedQuery)

Example 9 with PreparedQuery

use of io.micronaut.data.model.runtime.PreparedQuery in project micronaut-data by micronaut-projects.

the class DefaultMongoRepositoryOperations method getCount.

private <T, R> R getCount(ClientSession clientSession, MongoPreparedQuery<T, R, MongoDatabase> preparedQuery) {
    Class<R> resultType = preparedQuery.getResultType();
    RuntimePersistentEntity<T> persistentEntity = preparedQuery.getRuntimePersistentEntity();
    MongoDatabase database = preparedQuery.getDatabase();
    if (preparedQuery.isAggregate()) {
        MongoAggregation aggregation = preparedQuery.getAggregation();
        if (QUERY_LOG.isDebugEnabled()) {
            QUERY_LOG.debug("Executing Mongo 'aggregate' with pipeline: {}", aggregation.getPipeline().stream().map(e -> e.toBsonDocument().toJson()).collect(Collectors.toList()));
        }
        R result = aggregate(clientSession, preparedQuery, BsonDocument.class).map(bsonDocument -> convertResult(database.getCodecRegistry(), resultType, bsonDocument, false)).first();
        if (result == null) {
            result = conversionService.convertRequired(0, resultType);
        }
        return result;
    } else {
        MongoFind find = preparedQuery.getFind();
        MongoFindOptions options = find.getOptions();
        Bson filter = options == null ? null : options.getFilter();
        filter = filter == null ? new BsonDocument() : filter;
        if (QUERY_LOG.isDebugEnabled()) {
            QUERY_LOG.debug("Executing Mongo 'countDocuments' with filter: {}", filter.toBsonDocument().toJson());
        }
        long count = getCollection(database, persistentEntity, BsonDocument.class).countDocuments(clientSession, filter);
        return conversionService.convertRequired(count, resultType);
    }
}
Also used : InsertManyResult(com.mongodb.client.result.InsertManyResult) DataType(io.micronaut.data.model.DataType) BeanContext(io.micronaut.context.BeanContext) Spliterators(java.util.Spliterators) MongoDatabase(com.mongodb.client.MongoDatabase) ExecutorReactiveOperations(io.micronaut.data.runtime.operations.ExecutorReactiveOperations) Internal(io.micronaut.core.annotation.Internal) BsonValue(org.bson.BsonValue) EachBean(io.micronaut.context.annotation.EachBean) StoredQuery(io.micronaut.data.model.runtime.StoredQuery) UpdateResult(com.mongodb.client.result.UpdateResult) Map(java.util.Map) DataAccessException(io.micronaut.data.exceptions.DataAccessException) DeleteOperation(io.micronaut.data.model.runtime.DeleteOperation) RuntimeAssociation(io.micronaut.data.model.runtime.RuntimeAssociation) CursorType(com.mongodb.CursorType) AsyncCapableRepository(io.micronaut.data.operations.async.AsyncCapableRepository) DeleteOneModel(com.mongodb.client.model.DeleteOneModel) PersistentProperty(io.micronaut.data.model.PersistentProperty) InsertOneResult(com.mongodb.client.result.InsertOneResult) RuntimePersistentProperty(io.micronaut.data.model.runtime.RuntimePersistentProperty) Predicate(java.util.function.Predicate) AggregateIterable(com.mongodb.client.AggregateIterable) Qualifiers(io.micronaut.inject.qualifiers.Qualifiers) BsonDocumentWrapper(org.bson.BsonDocumentWrapper) Collectors(java.util.stream.Collectors) Executors(java.util.concurrent.Executors) PreparedQuery(io.micronaut.data.model.runtime.PreparedQuery) Serializable(java.io.Serializable) List(java.util.List) Stream(java.util.stream.Stream) FindIterable(com.mongodb.client.FindIterable) Dialect(io.micronaut.data.model.query.builder.sql.Dialect) Optional(java.util.Optional) MongoSynchronousTransactionManager(io.micronaut.data.mongodb.transaction.MongoSynchronousTransactionManager) Spliterator(java.util.Spliterator) MongoAggregationOptions(io.micronaut.data.mongodb.operations.options.MongoAggregationOptions) Named(jakarta.inject.Named) MongoDatabaseFactory(io.micronaut.data.mongodb.database.MongoDatabaseFactory) ReplaceOneModel(com.mongodb.client.model.ReplaceOneModel) Parameter(io.micronaut.context.annotation.Parameter) MongoClient(com.mongodb.client.MongoClient) MongoCollection(com.mongodb.client.MongoCollection) BeanProperty(io.micronaut.core.beans.BeanProperty) RuntimeEntityRegistry(io.micronaut.data.model.runtime.RuntimeEntityRegistry) CodecRegistry(org.bson.codecs.configuration.CodecRegistry) RequiresSyncMongo(io.micronaut.data.mongodb.conf.RequiresSyncMongo) Function(java.util.function.Function) BsonDocument(org.bson.BsonDocument) ArrayList(java.util.ArrayList) Filters(com.mongodb.client.model.Filters) Bson(org.bson.conversions.Bson) MongoCursor(com.mongodb.client.MongoCursor) OperationContext(io.micronaut.data.runtime.operations.internal.OperationContext) Nullable(io.micronaut.core.annotation.Nullable) Page(io.micronaut.data.model.Page) Pageable(io.micronaut.data.model.Pageable) ReactiveCapableRepository(io.micronaut.data.operations.reactive.ReactiveCapableRepository) ExecutorAsyncOperations(io.micronaut.data.runtime.operations.ExecutorAsyncOperations) StreamSupport(java.util.stream.StreamSupport) AttributeConverterRegistry(io.micronaut.data.model.runtime.AttributeConverterRegistry) ReactiveRepositoryOperations(io.micronaut.data.operations.reactive.ReactiveRepositoryOperations) DateTimeProvider(io.micronaut.data.runtime.date.DateTimeProvider) ExecutorService(java.util.concurrent.ExecutorService) Collation(com.mongodb.client.model.Collation) MediaTypeCodec(io.micronaut.http.codec.MediaTypeCodec) PagedQuery(io.micronaut.data.model.runtime.PagedQuery) UpdateOneModel(com.mongodb.client.model.UpdateOneModel) MongoFindOptions(io.micronaut.data.mongodb.operations.options.MongoFindOptions) AbstractSyncEntityOperations(io.micronaut.data.runtime.operations.internal.AbstractSyncEntityOperations) DataConversionService(io.micronaut.data.runtime.convert.DataConversionService) InsertBatchOperation(io.micronaut.data.model.runtime.InsertBatchOperation) SyncCascadeOperations(io.micronaut.data.runtime.operations.internal.SyncCascadeOperations) TimeUnit(java.util.concurrent.TimeUnit) Consumer(java.util.function.Consumer) NonNull(io.micronaut.core.annotation.NonNull) BulkWriteResult(com.mongodb.bulk.BulkWriteResult) DeleteResult(com.mongodb.client.result.DeleteResult) DeleteBatchOperation(io.micronaut.data.model.runtime.DeleteBatchOperation) InsertOperation(io.micronaut.data.model.runtime.InsertOperation) AbstractSyncEntitiesOperations(io.micronaut.data.runtime.operations.internal.AbstractSyncEntitiesOperations) AnnotationMetadata(io.micronaut.core.annotation.AnnotationMetadata) ClientSession(com.mongodb.client.ClientSession) RuntimePersistentEntity(io.micronaut.data.model.runtime.RuntimePersistentEntity) MongoIterable(com.mongodb.client.MongoIterable) UpdateBatchOperation(io.micronaut.data.model.runtime.UpdateBatchOperation) UpdateOperation(io.micronaut.data.model.runtime.UpdateOperation) Collections(java.util.Collections) MongoFindOptions(io.micronaut.data.mongodb.operations.options.MongoFindOptions) BsonDocument(org.bson.BsonDocument) MongoDatabase(com.mongodb.client.MongoDatabase) Bson(org.bson.conversions.Bson)

Example 10 with PreparedQuery

use of io.micronaut.data.model.runtime.PreparedQuery in project micronaut-data by micronaut-projects.

the class DefaultMongoRepositoryOperations method findAllAggregated.

private <T, R> Iterable<R> findAllAggregated(ClientSession clientSession, MongoPreparedQuery<T, R, MongoDatabase> preparedQuery, boolean stream) {
    Pageable pageable = preparedQuery.getPageable();
    int limit = pageable == Pageable.UNPAGED ? -1 : pageable.getSize();
    Class<T> type = preparedQuery.getRootEntity();
    Class<R> resultType = preparedQuery.getResultType();
    MongoIterable<R> aggregate;
    if (!resultType.isAssignableFrom(type)) {
        MongoDatabase database = preparedQuery.getDatabase();
        aggregate = aggregate(clientSession, preparedQuery, BsonDocument.class).map(result -> convertResult(database.getCodecRegistry(), resultType, result, preparedQuery.isDtoProjection()));
    } else {
        aggregate = aggregate(clientSession, preparedQuery, resultType);
    }
    return stream ? aggregate : aggregate.into(new ArrayList<>(limit > 0 ? limit : 20));
}
Also used : InsertManyResult(com.mongodb.client.result.InsertManyResult) DataType(io.micronaut.data.model.DataType) BeanContext(io.micronaut.context.BeanContext) Spliterators(java.util.Spliterators) MongoDatabase(com.mongodb.client.MongoDatabase) ExecutorReactiveOperations(io.micronaut.data.runtime.operations.ExecutorReactiveOperations) Internal(io.micronaut.core.annotation.Internal) BsonValue(org.bson.BsonValue) EachBean(io.micronaut.context.annotation.EachBean) StoredQuery(io.micronaut.data.model.runtime.StoredQuery) UpdateResult(com.mongodb.client.result.UpdateResult) Map(java.util.Map) DataAccessException(io.micronaut.data.exceptions.DataAccessException) DeleteOperation(io.micronaut.data.model.runtime.DeleteOperation) RuntimeAssociation(io.micronaut.data.model.runtime.RuntimeAssociation) CursorType(com.mongodb.CursorType) AsyncCapableRepository(io.micronaut.data.operations.async.AsyncCapableRepository) DeleteOneModel(com.mongodb.client.model.DeleteOneModel) PersistentProperty(io.micronaut.data.model.PersistentProperty) InsertOneResult(com.mongodb.client.result.InsertOneResult) RuntimePersistentProperty(io.micronaut.data.model.runtime.RuntimePersistentProperty) Predicate(java.util.function.Predicate) AggregateIterable(com.mongodb.client.AggregateIterable) Qualifiers(io.micronaut.inject.qualifiers.Qualifiers) BsonDocumentWrapper(org.bson.BsonDocumentWrapper) Collectors(java.util.stream.Collectors) Executors(java.util.concurrent.Executors) PreparedQuery(io.micronaut.data.model.runtime.PreparedQuery) Serializable(java.io.Serializable) List(java.util.List) Stream(java.util.stream.Stream) FindIterable(com.mongodb.client.FindIterable) Dialect(io.micronaut.data.model.query.builder.sql.Dialect) Optional(java.util.Optional) MongoSynchronousTransactionManager(io.micronaut.data.mongodb.transaction.MongoSynchronousTransactionManager) Spliterator(java.util.Spliterator) MongoAggregationOptions(io.micronaut.data.mongodb.operations.options.MongoAggregationOptions) Named(jakarta.inject.Named) MongoDatabaseFactory(io.micronaut.data.mongodb.database.MongoDatabaseFactory) ReplaceOneModel(com.mongodb.client.model.ReplaceOneModel) Parameter(io.micronaut.context.annotation.Parameter) MongoClient(com.mongodb.client.MongoClient) MongoCollection(com.mongodb.client.MongoCollection) BeanProperty(io.micronaut.core.beans.BeanProperty) RuntimeEntityRegistry(io.micronaut.data.model.runtime.RuntimeEntityRegistry) CodecRegistry(org.bson.codecs.configuration.CodecRegistry) RequiresSyncMongo(io.micronaut.data.mongodb.conf.RequiresSyncMongo) Function(java.util.function.Function) BsonDocument(org.bson.BsonDocument) ArrayList(java.util.ArrayList) Filters(com.mongodb.client.model.Filters) Bson(org.bson.conversions.Bson) MongoCursor(com.mongodb.client.MongoCursor) OperationContext(io.micronaut.data.runtime.operations.internal.OperationContext) Nullable(io.micronaut.core.annotation.Nullable) Page(io.micronaut.data.model.Page) Pageable(io.micronaut.data.model.Pageable) ReactiveCapableRepository(io.micronaut.data.operations.reactive.ReactiveCapableRepository) ExecutorAsyncOperations(io.micronaut.data.runtime.operations.ExecutorAsyncOperations) StreamSupport(java.util.stream.StreamSupport) AttributeConverterRegistry(io.micronaut.data.model.runtime.AttributeConverterRegistry) ReactiveRepositoryOperations(io.micronaut.data.operations.reactive.ReactiveRepositoryOperations) DateTimeProvider(io.micronaut.data.runtime.date.DateTimeProvider) ExecutorService(java.util.concurrent.ExecutorService) Collation(com.mongodb.client.model.Collation) MediaTypeCodec(io.micronaut.http.codec.MediaTypeCodec) PagedQuery(io.micronaut.data.model.runtime.PagedQuery) UpdateOneModel(com.mongodb.client.model.UpdateOneModel) MongoFindOptions(io.micronaut.data.mongodb.operations.options.MongoFindOptions) AbstractSyncEntityOperations(io.micronaut.data.runtime.operations.internal.AbstractSyncEntityOperations) DataConversionService(io.micronaut.data.runtime.convert.DataConversionService) InsertBatchOperation(io.micronaut.data.model.runtime.InsertBatchOperation) SyncCascadeOperations(io.micronaut.data.runtime.operations.internal.SyncCascadeOperations) TimeUnit(java.util.concurrent.TimeUnit) Consumer(java.util.function.Consumer) NonNull(io.micronaut.core.annotation.NonNull) BulkWriteResult(com.mongodb.bulk.BulkWriteResult) DeleteResult(com.mongodb.client.result.DeleteResult) DeleteBatchOperation(io.micronaut.data.model.runtime.DeleteBatchOperation) InsertOperation(io.micronaut.data.model.runtime.InsertOperation) AbstractSyncEntitiesOperations(io.micronaut.data.runtime.operations.internal.AbstractSyncEntitiesOperations) AnnotationMetadata(io.micronaut.core.annotation.AnnotationMetadata) ClientSession(com.mongodb.client.ClientSession) RuntimePersistentEntity(io.micronaut.data.model.runtime.RuntimePersistentEntity) MongoIterable(com.mongodb.client.MongoIterable) UpdateBatchOperation(io.micronaut.data.model.runtime.UpdateBatchOperation) UpdateOperation(io.micronaut.data.model.runtime.UpdateOperation) Collections(java.util.Collections) Pageable(io.micronaut.data.model.Pageable) ArrayList(java.util.ArrayList) MongoDatabase(com.mongodb.client.MongoDatabase)

Aggregations

PreparedQuery (io.micronaut.data.model.runtime.PreparedQuery)10 Nullable (io.micronaut.core.annotation.Nullable)8 PagedQuery (io.micronaut.data.model.runtime.PagedQuery)8 Parameter (io.micronaut.context.annotation.Parameter)7 NonNull (io.micronaut.core.annotation.NonNull)7 BeanProperty (io.micronaut.core.beans.BeanProperty)7 Page (io.micronaut.data.model.Page)7 DeleteBatchOperation (io.micronaut.data.model.runtime.DeleteBatchOperation)7 DeleteOperation (io.micronaut.data.model.runtime.DeleteOperation)7 InsertBatchOperation (io.micronaut.data.model.runtime.InsertBatchOperation)7 InsertOperation (io.micronaut.data.model.runtime.InsertOperation)7 RuntimePersistentEntity (io.micronaut.data.model.runtime.RuntimePersistentEntity)7 RuntimePersistentProperty (io.micronaut.data.model.runtime.RuntimePersistentProperty)7 StoredQuery (io.micronaut.data.model.runtime.StoredQuery)7 UpdateOperation (io.micronaut.data.model.runtime.UpdateOperation)7 BeanContext (io.micronaut.context.BeanContext)6 EachBean (io.micronaut.context.annotation.EachBean)6 AnnotationMetadata (io.micronaut.core.annotation.AnnotationMetadata)6 DataType (io.micronaut.data.model.DataType)6 RuntimeEntityRegistry (io.micronaut.data.model.runtime.RuntimeEntityRegistry)6