Search in sources :

Example 1 with PreparedQuery

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

the class DefaultDeleteAllReactiveInterceptor method intercept.

@Override
public Object intercept(RepositoryMethodKey methodKey, MethodInvocationContext<Object, Object> context) {
    Argument<Object> arg = context.getReturnType().asArgument();
    Optional<Iterable<Object>> deleteEntities = findEntitiesParameter(context, Object.class);
    Optional<Object> deleteEntity = findEntityParameter(context, Object.class);
    Publisher publisher;
    if (!deleteEntity.isPresent() && !deleteEntities.isPresent()) {
        PreparedQuery<?, Number> preparedQuery = (PreparedQuery<?, Number>) prepareQuery(methodKey, context);
        publisher = reactiveOperations.executeDelete(preparedQuery);
    } else if (deleteEntity.isPresent()) {
        publisher = reactiveOperations.delete(getDeleteOperation(context, deleteEntity.get()));
    } else {
        publisher = reactiveOperations.deleteAll(getDeleteBatchOperation(context, deleteEntities.get()));
    }
    return Publishers.convertPublisher(publisher, arg.getType());
}
Also used : PreparedQuery(io.micronaut.data.model.runtime.PreparedQuery) Publisher(org.reactivestreams.Publisher)

Example 2 with PreparedQuery

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

the class HibernateJpaOperations method findOne.

@Nullable
@Override
public <T, R> R findOne(@NonNull PreparedQuery<T, R> preparedQuery) {
    return transactionOperations.executeRead(status -> {
        Class<R> resultType = preparedQuery.getResultType();
        String query = preparedQuery.getQuery();
        Session currentSession = sessionFactory.getCurrentSession();
        if (preparedQuery.isDtoProjection()) {
            Query<Tuple> q;
            if (preparedQuery.isNative()) {
                q = currentSession.createNativeQuery(query, Tuple.class);
            } else if (query.toLowerCase(Locale.ENGLISH).startsWith("select new ")) {
                Query<R> dtoQuery = currentSession.createQuery(query, resultType);
                bindParameters(dtoQuery, preparedQuery, query);
                bindQueryHints(dtoQuery, preparedQuery, currentSession);
                return dtoQuery.uniqueResult();
            } else {
                q = currentSession.createQuery(query, Tuple.class);
            }
            bindParameters(q, preparedQuery, query);
            bindQueryHints(q, preparedQuery, currentSession);
            Tuple tuple = first(q);
            if (tuple != null) {
                return (new BeanIntrospectionMapper<Tuple, R>() {

                    @Override
                    public Object read(Tuple tuple1, String alias) {
                        return tuple1.get(alias);
                    }

                    @Override
                    public ConversionService<?> getConversionService() {
                        return dataConversionService;
                    }
                }).map(tuple, resultType);
            }
            return null;
        } else {
            Query<R> q;
            if (preparedQuery.isNative()) {
                if (DataType.ENTITY.equals(preparedQuery.getResultDataType())) {
                    q = currentSession.createNativeQuery(query, resultType);
                } else {
                    q = currentSession.createNativeQuery(query);
                }
            } else {
                q = currentSession.createQuery(query, resultType);
            }
            bindParameters(q, preparedQuery, query);
            bindQueryHints(q, preparedQuery, currentSession);
            return first(q);
        }
    });
}
Also used : 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) BeanIntrospectionMapper(io.micronaut.data.runtime.mapper.BeanIntrospectionMapper) Tuple(javax.persistence.Tuple) Session(org.hibernate.Session) Nullable(io.micronaut.core.annotation.Nullable)

Example 3 with PreparedQuery

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

the class DefaultMongoRepositoryOperations method findOneAggregated.

private <T, R> R findOneAggregated(ClientSession clientSession, MongoPreparedQuery<T, R, MongoDatabase> preparedQuery) {
    MongoDatabase database = preparedQuery.getDatabase();
    Class<T> type = preparedQuery.getRootEntity();
    Class<R> resultType = preparedQuery.getResultType();
    if (!resultType.isAssignableFrom(type)) {
        BsonDocument result = aggregate(clientSession, preparedQuery, BsonDocument.class).first();
        return convertResult(database.getCodecRegistry(), resultType, result, preparedQuery.isDtoProjection());
    }
    return aggregate(clientSession, preparedQuery).map(r -> {
        RuntimePersistentEntity<T> persistentEntity = preparedQuery.getRuntimePersistentEntity();
        if (type.isInstance(r)) {
            return (R) triggerPostLoad(preparedQuery.getAnnotationMetadata(), persistentEntity, type.cast(r));
        }
        return r;
    }).first();
}
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) RuntimePersistentEntity(io.micronaut.data.model.runtime.RuntimePersistentEntity) BsonDocument(org.bson.BsonDocument) MongoDatabase(com.mongodb.client.MongoDatabase)

Example 4 with PreparedQuery

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

the class DefaultMongoRepositoryOperations method findAllFiltered.

private <T, R> Iterable<R> findAllFiltered(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> findIterable;
    if (!resultType.isAssignableFrom(type)) {
        MongoDatabase database = preparedQuery.getDatabase();
        findIterable = find(clientSession, preparedQuery, BsonDocument.class).map(result -> convertResult(database.getCodecRegistry(), resultType, result, preparedQuery.isDtoProjection()));
    } else {
        findIterable = find(clientSession, preparedQuery);
    }
    return stream ? findIterable : findIterable.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)

Example 5 with PreparedQuery

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

the class DefaultReactiveMongoRepositoryOperations method getCount.

private <T, R> Mono<R> getCount(ClientSession clientSession, MongoPreparedQuery<T, R, MongoDatabase> preparedQuery) {
    Class<R> resultType = preparedQuery.getResultType();
    MongoDatabase database = preparedQuery.getDatabase();
    RuntimePersistentEntity<T> persistentEntity = preparedQuery.getRuntimePersistentEntity();
    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()));
        }
        return Mono.from(aggregate(clientSession, preparedQuery, BsonDocument.class).first()).map(bsonDocument -> convertResult(database.getCodecRegistry(), resultType, bsonDocument, false)).switchIfEmpty(Mono.defer(() -> Mono.just(conversionService.convertRequired(0, resultType))));
    } 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());
        }
        return Mono.from(getCollection(database, persistentEntity, BsonDocument.class).countDocuments(clientSession, filter)).map(count -> conversionService.convertRequired(count, resultType));
    }
}
Also used : DataType(io.micronaut.data.model.DataType) BeanContext(io.micronaut.context.BeanContext) LoggerFactory(org.slf4j.LoggerFactory) Tuples(reactor.util.function.Tuples) MongoCollection(com.mongodb.reactivestreams.client.MongoCollection) Internal(io.micronaut.core.annotation.Internal) ReactiveCascadeOperations(io.micronaut.data.runtime.operations.internal.ReactiveCascadeOperations) NoTransactionException(io.micronaut.transaction.exceptions.NoTransactionException) BsonValue(org.bson.BsonValue) EachBean(io.micronaut.context.annotation.EachBean) StoredQuery(io.micronaut.data.model.runtime.StoredQuery) 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) DeleteOneModel(com.mongodb.client.model.DeleteOneModel) PersistentProperty(io.micronaut.data.model.PersistentProperty) TransactionDefinition(io.micronaut.transaction.TransactionDefinition) RuntimePersistentProperty(io.micronaut.data.model.runtime.RuntimePersistentProperty) Predicate(java.util.function.Predicate) Qualifiers(io.micronaut.inject.qualifiers.Qualifiers) BsonDocumentWrapper(org.bson.BsonDocumentWrapper) Collectors(java.util.stream.Collectors) ReactiveMongoDatabaseFactory(io.micronaut.data.mongodb.database.ReactiveMongoDatabaseFactory) PreparedQuery(io.micronaut.data.model.runtime.PreparedQuery) Serializable(java.io.Serializable) Objects(java.util.Objects) List(java.util.List) ReactiveTransactionStatus(io.micronaut.transaction.reactive.ReactiveTransactionStatus) FindPublisher(com.mongodb.reactivestreams.client.FindPublisher) Dialect(io.micronaut.data.model.query.builder.sql.Dialect) TransactionUsageException(io.micronaut.transaction.exceptions.TransactionUsageException) MongoAggregationOptions(io.micronaut.data.mongodb.operations.options.MongoAggregationOptions) ReplaceOneModel(com.mongodb.client.model.ReplaceOneModel) Parameter(io.micronaut.context.annotation.Parameter) BeanProperty(io.micronaut.core.beans.BeanProperty) AbstractReactiveEntitiesOperations(io.micronaut.data.runtime.operations.internal.AbstractReactiveEntitiesOperations) Tuple2(reactor.util.function.Tuple2) RuntimeEntityRegistry(io.micronaut.data.model.runtime.RuntimeEntityRegistry) CodecRegistry(org.bson.codecs.configuration.CodecRegistry) Function(java.util.function.Function) MongoClient(com.mongodb.reactivestreams.client.MongoClient) ReactorReactiveRepositoryOperations(io.micronaut.data.operations.reactive.ReactorReactiveRepositoryOperations) BsonDocument(org.bson.BsonDocument) ArrayList(java.util.ArrayList) Filters(com.mongodb.client.model.Filters) Bson(org.bson.conversions.Bson) MongoDatabase(com.mongodb.reactivestreams.client.MongoDatabase) OperationContext(io.micronaut.data.runtime.operations.internal.OperationContext) Nullable(io.micronaut.core.annotation.Nullable) Page(io.micronaut.data.model.Page) Argument(io.micronaut.core.type.Argument) RequiresReactiveMongo(io.micronaut.data.mongodb.conf.RequiresReactiveMongo) AttributeConverterRegistry(io.micronaut.data.model.runtime.AttributeConverterRegistry) DateTimeProvider(io.micronaut.data.runtime.date.DateTimeProvider) Collation(com.mongodb.client.model.Collation) MediaTypeCodec(io.micronaut.http.codec.MediaTypeCodec) PagedQuery(io.micronaut.data.model.runtime.PagedQuery) Logger(org.slf4j.Logger) UpdateOneModel(com.mongodb.client.model.UpdateOneModel) MongoFindOptions(io.micronaut.data.mongodb.operations.options.MongoFindOptions) Publisher(org.reactivestreams.Publisher) DataConversionService(io.micronaut.data.runtime.convert.DataConversionService) Mono(reactor.core.publisher.Mono) ReactiveTransactionOperations(io.micronaut.transaction.reactive.ReactiveTransactionOperations) ClientSession(com.mongodb.reactivestreams.client.ClientSession) InsertBatchOperation(io.micronaut.data.model.runtime.InsertBatchOperation) TimeUnit(java.util.concurrent.TimeUnit) NonNull(io.micronaut.core.annotation.NonNull) Flux(reactor.core.publisher.Flux) AggregatePublisher(com.mongodb.reactivestreams.client.AggregatePublisher) ConversionContext(io.micronaut.core.convert.ConversionContext) DeleteResult(com.mongodb.client.result.DeleteResult) DeleteBatchOperation(io.micronaut.data.model.runtime.DeleteBatchOperation) InsertOperation(io.micronaut.data.model.runtime.InsertOperation) AnnotationMetadata(io.micronaut.core.annotation.AnnotationMetadata) TransactionSystemException(io.micronaut.transaction.exceptions.TransactionSystemException) RuntimePersistentEntity(io.micronaut.data.model.runtime.RuntimePersistentEntity) AbstractReactiveEntityOperations(io.micronaut.data.runtime.operations.internal.AbstractReactiveEntityOperations) UpdateBatchOperation(io.micronaut.data.model.runtime.UpdateBatchOperation) UpdateOperation(io.micronaut.data.model.runtime.UpdateOperation) DataSettings(io.micronaut.data.runtime.config.DataSettings) Collections(java.util.Collections) MongoFindOptions(io.micronaut.data.mongodb.operations.options.MongoFindOptions) BsonDocument(org.bson.BsonDocument) MongoDatabase(com.mongodb.reactivestreams.client.MongoDatabase) Bson(org.bson.conversions.Bson)

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