Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated code for Micronaut Framework 5. #2843

Draft
wants to merge 7 commits into
base: 5.0.x
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions config/accepted-api-changes.json
Original file line number Diff line number Diff line change
@@ -1,2 +1,27 @@
[
{
"type": "io.micronaut.data.processor.visitors.finders.AbstractPatternMethodMatcher",
"member": "Field patternWithBySyntax",
"reason": "Removed deprecated code for Micronaut Framework 5."
},
{
"type": "io.micronaut.data.processor.visitors.finders.AbstractPatternMethodMatcher",
"member": "Field patternWithoutBySyntax",
"reason": "Removed deprecated code for Micronaut Framework 5."
},
{
"type": "io.micronaut.data.processor.visitors.finders.AbstractPatternMethodMatcher",
"member": "Constructor io.micronaut.data.processor.visitors.finders.AbstractPatternMethodMatcher(boolean,java.lang.String[])",
"reason": "Removed deprecated code for Micronaut Framework 5."
},
{
"type": "io.micronaut.data.processor.visitors.finders.AbstractPatternMethodMatcher",
"member": "Implemented interface io.micronaut.data.processor.visitors.finders.MethodMatcher",
"reason": "Removed deprecated code for Micronaut Framework 5."
},
{
"type": "io.micronaut.data.processor.visitors.finders.AbstractPatternMethodMatcher",
"member": "Implemented interface io.micronaut.core.order.Ordered",
"reason": "Removed deprecated code for Micronaut Framework 5."
}
]
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017-2020 original authors
* Copyright 2017-2024 original authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -17,20 +17,17 @@

import io.micronaut.core.annotation.Nullable;
import io.micronaut.data.annotation.Id;
import io.micronaut.data.annotation.Join;
import io.micronaut.data.annotation.ParameterExpression;
import io.micronaut.data.annotation.Query;
import io.micronaut.data.annotation.Repository;
import io.micronaut.data.annotation.Where;
import io.micronaut.data.jpa.annotation.EntityGraph;
import io.micronaut.data.jpa.repository.JpaSpecificationExecutor;
import io.micronaut.data.model.Page;
import io.micronaut.data.model.Pageable;
import io.micronaut.data.tck.entities.Author;
import io.micronaut.data.tck.entities.Book;
import io.micronaut.data.tck.repositories.AuthorRepository;

import jakarta.transaction.Transactional;

import java.util.Collection;
import java.util.List;

Expand All @@ -41,22 +38,6 @@ public BookRepository(AuthorRepository authorRepository) {
super(authorRepository);
}

/**
* @deprecated Order by 'author.name' case without a join. Hibernate will do the cross join if the association property is accessed by the property path without join.
*/
@Override
@Query(value = "SELECT book_ FROM Book book_", countQuery = "SELECT count(book_) FROM Book book_ ")
@Join(value = "author", type = Join.Type.FETCH)
@Deprecated
public abstract Page<Book> listPageableCustomQuery(Pageable pageable);

/**
* @deprecated Order by 'author.name' case without a join. Hibernate will do the cross join if the association property is accessed by the property path without join.
*/
@Query(value = "SELECT book_ FROM Book book_", countQuery = "SELECT count(book_) FROM Book book_ ")
@Deprecated
public abstract Page<Book> listPageableCustomQuery2(Pageable pageable);

@EntityGraph(
attributePaths = {
"totalPages",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017-2020 original authors
* Copyright 2017-2024 original authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -15,17 +15,16 @@
*/
package io.micronaut.data.intercept.annotation;

import io.micronaut.context.annotation.Property;
import io.micronaut.core.annotation.Internal;
import io.micronaut.data.intercept.DataInterceptor;
import io.micronaut.data.model.DataType;

import java.io.Serializable;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.lang.annotation.Inherited;

/**
* Internal annotation used to configure execution handling for io.micronaut.data.runtime.intercept.DataIntroductionAdvice.
Expand Down Expand Up @@ -84,41 +83,6 @@
*/
String META_MEMBER_INTERCEPTOR = "interceptor";

/**
* The member name that holds parameter binding.
* @deprecated No longer used
*/
@Deprecated(forRemoval = true)
String META_MEMBER_PARAMETER_BINDING = "parameterBinding";

/**
* The member name that holds parameter binding paths.
* @deprecated No longer used
*/
@Deprecated(forRemoval = true)
String META_MEMBER_PARAMETER_BINDING_PATHS = META_MEMBER_PARAMETER_BINDING + "Paths";

/**
* The member name that holds parameter auto-populated property paths.
* @deprecated No longer used
*/
@Deprecated(forRemoval = true)
String META_MEMBER_PARAMETER_AUTO_POPULATED_PROPERTY_PATHS = META_MEMBER_PARAMETER_BINDING + "AutoPopulatedPaths";

/**
* The member name that holds parameter auto-populated property paths.
* @deprecated No longer used
*/
@Deprecated(forRemoval = true)
String META_MEMBER_PARAMETER_AUTO_POPULATED_PREVIOUS_PROPERTY_PATHS = META_MEMBER_PARAMETER_BINDING + "AutoPopulatedPreviousPaths";

/**
* The member name that holds parameter auto-populated property paths.
* @deprecated No longer used
*/
@Deprecated(forRemoval = true)
String META_MEMBER_PARAMETER_AUTO_POPULATED_PREVIOUS_PROPERTY_INDEXES = META_MEMBER_PARAMETER_BINDING + "AutoPopulatedPrevious";

/**
* The ID type.
*/
Expand Down Expand Up @@ -169,20 +133,6 @@
*/
String META_MEMBER_RAW_COUNT_QUERY = "rawCountQuery";

/**
* Meta member for storing the parameter type defs.
* @deprecated No longer used
*/
@Deprecated(forRemoval = true)
String META_MEMBER_PARAMETER_TYPE_DEFS = "parameterTypeDefs";

/**
* Meta member for storing the parameter converters.
* @deprecated No longer used
*/
@Deprecated(forRemoval = true)
String META_MEMBER_PARAMETER_CONVERTERS = "parameterConverters";

/**
* Meta member for storing the parameters.
*/
Expand Down Expand Up @@ -224,17 +174,6 @@
*/
Class<?> idType() default Serializable.class;

/**
* The parameter binding defines which method arguments bind to which
* query parameters. The {@link Property#name()} is used to define the query parameter name and the
* {@link Property#value()} is used to define method argument name to bind.
*
* @return The parameter binding.
* @deprecated No longer used
*/
@Deprecated(forRemoval = true)
Property[] parameterBinding() default {};

/**
* The argument that defines the pageable object.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017-2020 original authors
* Copyright 2017-2024 original authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -15,8 +15,8 @@
*/
package io.micronaut.data.model;

import io.micronaut.core.annotation.NonNull;
import io.micronaut.core.annotation.AnnotationMetadata;
import io.micronaut.core.annotation.NonNull;
import io.micronaut.core.annotation.Nullable;
import io.micronaut.core.naming.NameUtils;
import io.micronaut.data.annotation.AutoPopulated;
Expand All @@ -42,16 +42,6 @@ public interface PersistentProperty extends PersistentElement {
@Override
@NonNull String getName();

/**
* The name with the first letter in upper case as per Java bean conventions.
* @return The capitilized name
* @deprecated The method with a type replaced with {@link #getCapitalizedName()}.
*/
@Deprecated(forRemoval = true)
default @NonNull String getCapitilizedName() {
return NameUtils.capitalize(getName());
}

/**
* The name with the first letter in upper case as per Java bean conventions.
* @return The capitalized name
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017-2020 original authors
* Copyright 2017-2024 original authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -1927,23 +1927,6 @@ public QueryResult buildOrderBy(@NonNull PersistentEntity entity, @NonNull Sort
return buildOrderBy("", entity, AnnotationMetadata.EMPTY_METADATA, sort, false);
}

/**
* Encode the given query into the encoded query instance.
*
* @param query The query
* @param entity The root entity
* @param annotationMetadata The annotation metadata
* @param sort The sort
* @return The encoded query
*
* @deprecated use {@link #buildOrderBy(String, PersistentEntity, AnnotationMetadata, Sort, boolean)}
*/
@NonNull
@Deprecated(forRemoval = true, since = "4.2.0")
public QueryResult buildOrderBy(String query, @NonNull PersistentEntity entity, @NonNull AnnotationMetadata annotationMetadata, @NonNull Sort sort) {
return buildOrderBy(query, entity, annotationMetadata, sort, false);
}

/**
* Encode the given query into the encoded query instance.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017-2020 original authors
* Copyright 2017-2024 original authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -19,15 +19,13 @@
import io.micronaut.core.annotation.Experimental;
import io.micronaut.core.annotation.NonNull;
import io.micronaut.core.naming.Named;
import io.micronaut.core.reflect.ReflectionUtils;
import io.micronaut.core.type.Argument;
import io.micronaut.data.model.DataType;
import io.micronaut.data.model.query.JoinPath;

import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;

/**
Expand Down Expand Up @@ -127,14 +125,6 @@ default boolean isProcedure() {
*/
OperationType getOperationType();

/**
* Are the placeholders for query set using numeric indices starting from 1.
* @return True if they are.
* @deprecated Not used anymore
*/
@Deprecated(forRemoval = true)
boolean useNumericPlaceholders();

/**
* Returns whether the query returns the actual entity or a Data Transfer Object (DTO) project. Defaults to false.
*
Expand All @@ -144,29 +134,6 @@ default boolean isDtoProjection() {
return false;
}

/**
* The type of the ID member of the entity.
*
* @return The ID type
* @deprecated Not used anymore
*/
@Deprecated(forRemoval = true)
default Optional<Class<?>> getEntityIdentifierType() {
return Optional.empty();
}

/**
* The argument types to the method that invokes the query.
*
* @return The argument types
* @deprecated Not used anymore
*/
@Deprecated(forRemoval = true)
@NonNull
default Class<?>[] getArgumentTypes() {
return ReflectionUtils.EMPTY_CLASS_ARRAY;
}

/**
* @return Is this a count query.
*/
Expand All @@ -189,14 +156,6 @@ default Map<String, Object> getQueryHints() {
return Collections.emptySet();
}

/**
* Whether the query can be treated as a single result.
* @return True if it can.
* @deprecated Not used anymore
*/
@Deprecated(forRemoval = true)
boolean isSingleResult();

/**
* @return Whether a result consumer is present
*/
Expand Down
Loading
Loading