From d609db5b32b02cf8ad660afda96d740bc568a001 Mon Sep 17 00:00:00 2001 From: Otavio Santana Date: Mon, 11 Mar 2024 18:35:48 +0000 Subject: [PATCH] feat: remove api duplicated Signed-off-by: Otavio Santana --- .../jnosql/mapping/AttributeConverter.java | 43 -------------- .../org/eclipse/jnosql/mapping/Convert.java | 35 ----------- .../jnosql/mapping/DiscriminatorColumn.java | 59 ------------------- .../jnosql/mapping/DiscriminatorValue.java | 44 -------------- .../eclipse/jnosql/mapping/Embeddable.java | 29 --------- .../eclipse/jnosql/mapping/Inheritance.java | 45 -------------- .../jnosql/mapping/MappedSuperclass.java | 31 ---------- 7 files changed, 286 deletions(-) delete mode 100644 jnosql-mapping/jnosql-mapping-api-core/src/main/java/org/eclipse/jnosql/mapping/AttributeConverter.java delete mode 100644 jnosql-mapping/jnosql-mapping-api-core/src/main/java/org/eclipse/jnosql/mapping/Convert.java delete mode 100644 jnosql-mapping/jnosql-mapping-api-core/src/main/java/org/eclipse/jnosql/mapping/DiscriminatorColumn.java delete mode 100644 jnosql-mapping/jnosql-mapping-api-core/src/main/java/org/eclipse/jnosql/mapping/DiscriminatorValue.java delete mode 100644 jnosql-mapping/jnosql-mapping-api-core/src/main/java/org/eclipse/jnosql/mapping/Embeddable.java delete mode 100644 jnosql-mapping/jnosql-mapping-api-core/src/main/java/org/eclipse/jnosql/mapping/Inheritance.java delete mode 100644 jnosql-mapping/jnosql-mapping-api-core/src/main/java/org/eclipse/jnosql/mapping/MappedSuperclass.java diff --git a/jnosql-mapping/jnosql-mapping-api-core/src/main/java/org/eclipse/jnosql/mapping/AttributeConverter.java b/jnosql-mapping/jnosql-mapping-api-core/src/main/java/org/eclipse/jnosql/mapping/AttributeConverter.java deleted file mode 100644 index f8bbc302c..000000000 --- a/jnosql-mapping/jnosql-mapping-api-core/src/main/java/org/eclipse/jnosql/mapping/AttributeConverter.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2023 Contributors to the Eclipse Foundation - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * and Apache License v2.0 which accompanies this distribution. - * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html - * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. - * - * You may elect to redistribute this code under either of these licenses. - * - * Contributors: - * - * Otavio Santana - */ -package org.eclipse.jnosql.mapping; - -/** - * A class that implements this interface can be used to convert entity attribute state into database column - * representation and back again. Note that the X and Y types may be the same Java type. - * @param the type of the entity attribute - * @param the type of the database column - */ -public interface AttributeConverter { - - /** - * Converts the value stored in the entity attribute into the data representation to be stored in the database. - * - * @param attribute attribute the entity attribute value to be converted - * @return the converted data to be stored in the database column - */ - Y convertToDatabaseColumn(X attribute); - - /** - * Converts the data stored in the database column into the value to be stored in the entity attribute. - * Note that it is the responsibility of the converter writer to specify the correct dbData type for the - * corresponding column for use by the JDBC driver: i.e., persistence providers are not expected to do - * such type conversion. - * - * @param dbData the data from the database column to be converted - * @return the converted value to be stored in the entity attribute - */ - X convertToEntityAttribute(Y dbData); -} diff --git a/jnosql-mapping/jnosql-mapping-api-core/src/main/java/org/eclipse/jnosql/mapping/Convert.java b/jnosql-mapping/jnosql-mapping-api-core/src/main/java/org/eclipse/jnosql/mapping/Convert.java deleted file mode 100644 index f21ff0a1b..000000000 --- a/jnosql-mapping/jnosql-mapping-api-core/src/main/java/org/eclipse/jnosql/mapping/Convert.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2023 Contributors to the Eclipse Foundation - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * and Apache License v2.0 which accompanies this distribution. - * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html - * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. - * - * You may elect to redistribute this code under either of these licenses. - * - * Contributors: - * - * Otavio Santana - */ -package org.eclipse.jnosql.mapping; - - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Specifies the conversion of a Basic field or property. - */ -@Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.FIELD, ElementType.PARAMETER}) -public @interface Convert { - /** - * The converter - * - * @return the converter type - */ - Class> value(); -} diff --git a/jnosql-mapping/jnosql-mapping-api-core/src/main/java/org/eclipse/jnosql/mapping/DiscriminatorColumn.java b/jnosql-mapping/jnosql-mapping-api-core/src/main/java/org/eclipse/jnosql/mapping/DiscriminatorColumn.java deleted file mode 100644 index 249d74b1b..000000000 --- a/jnosql-mapping/jnosql-mapping-api-core/src/main/java/org/eclipse/jnosql/mapping/DiscriminatorColumn.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2023 Contributors to the Eclipse Foundation - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * and Apache License v2.0 which accompanies this distribution. - * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html - * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. - * - * You may elect to redistribute this code under either of these licenses. - * - * Contributors: - * - * Otavio Santana - */ -package org.eclipse.jnosql.mapping; - - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Specifies the discriminator column for the mapping strategy. - * If the DiscriminatorColumn annotation is missing, - * the name of the discriminator column defaults is "dtype". - * *

Example usage: - * *

{@code
- *  * @Entity
- *  * @DiscriminatorColumn(name = "dtype")
- *  * public class Animal {
- *  *     // Common fields and methods for all animals
- *  * }
- *  *
- *  * @Entity
- *  * public class Dog extends Animal {
- *  *     // Specific fields and methods for dogs
- *  * }
- *  *
- *  * @Entity
- *  * public class Cat extends Animal {
- *  *     // Specific fields and methods for cats
- *  * }
- *  * }
- */ -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.TYPE) -public @interface DiscriminatorColumn { - - /** - * The default name of the discriminator column, which is {@code "dtype"}. - */ - String DEFAULT_DISCRIMINATOR_COLUMN = "dtype"; - /** - * (Optional) The name of column to be used for the discriminator. - * @return the column's name - */ - String value() default DEFAULT_DISCRIMINATOR_COLUMN; -} diff --git a/jnosql-mapping/jnosql-mapping-api-core/src/main/java/org/eclipse/jnosql/mapping/DiscriminatorValue.java b/jnosql-mapping/jnosql-mapping-api-core/src/main/java/org/eclipse/jnosql/mapping/DiscriminatorValue.java deleted file mode 100644 index b73967bc8..000000000 --- a/jnosql-mapping/jnosql-mapping-api-core/src/main/java/org/eclipse/jnosql/mapping/DiscriminatorValue.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2023 Contributors to the Eclipse Foundation - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * and Apache License v2.0 which accompanies this distribution. - * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html - * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. - * - * You may elect to redistribute this code under either of these licenses. - * - * Contributors: - * - * Otavio Santana - */ -package org.eclipse.jnosql.mapping; - - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Specifies the value of the discriminator column for entities of the given type. - * - *

The DiscriminatorValue - * annotation can only be specified on a concrete entity - * class. - * - *

If the DiscriminatorValue annotation is not - * specified and a discriminator column is used, a provider-specific - * function will be used to generate a value representing the - * entity type. So the discriminator value default is the {@link Class#getSimpleName()}. - */ -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.TYPE) -public @interface DiscriminatorValue { - /** - * (Optional) The value that indicates that the - * row is an entity of the annotated entity type. - * @return the discriminator Value - */ - String value(); -} diff --git a/jnosql-mapping/jnosql-mapping-api-core/src/main/java/org/eclipse/jnosql/mapping/Embeddable.java b/jnosql-mapping/jnosql-mapping-api-core/src/main/java/org/eclipse/jnosql/mapping/Embeddable.java deleted file mode 100644 index 782a98231..000000000 --- a/jnosql-mapping/jnosql-mapping-api-core/src/main/java/org/eclipse/jnosql/mapping/Embeddable.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2023 Contributors to the Eclipse Foundation - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * and Apache License v2.0 which accompanies this distribution. - * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html - * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. - * - * You may elect to redistribute this code under either of these licenses. - * - * Contributors: - * - * Otavio Santana - */ -package org.eclipse.jnosql.mapping; - - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Specifies a class whose instances are stored as an intrinsic part of an owning entity and share the entity's identity. - */ -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.TYPE) -public @interface Embeddable { -} diff --git a/jnosql-mapping/jnosql-mapping-api-core/src/main/java/org/eclipse/jnosql/mapping/Inheritance.java b/jnosql-mapping/jnosql-mapping-api-core/src/main/java/org/eclipse/jnosql/mapping/Inheritance.java deleted file mode 100644 index 061c8f51d..000000000 --- a/jnosql-mapping/jnosql-mapping-api-core/src/main/java/org/eclipse/jnosql/mapping/Inheritance.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2023 Contributors to the Eclipse Foundation - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * and Apache License v2.0 which accompanies this distribution. - * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html - * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. - * - * You may elect to redistribute this code under either of these licenses. - * - * Contributors: - * - * Otavio Santana - */ -package org.eclipse.jnosql.mapping; - - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Specifies the inheritance strategy to be used for an entity class hierarchy. - * It is specified on the entity class that is the root of the entity class hierarchy. - * This class can be either a regular or an abstract; - * The table/column-family/document-collection will have a column for every attribute - * of every class in the hierarchy. - * The subclass will use the {@link jakarta.nosql.Entity} name from that class with this annotation. - * - *

- *
- *   Example:
- *   @Entity
- *   @Inheritance
- *   public class Notification { ... }
- *
- *   @Entity
- *   public class SMSNotification extends Notification { ... }
- * 
- */ -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.TYPE) -public @interface Inheritance { -} diff --git a/jnosql-mapping/jnosql-mapping-api-core/src/main/java/org/eclipse/jnosql/mapping/MappedSuperclass.java b/jnosql-mapping/jnosql-mapping-api-core/src/main/java/org/eclipse/jnosql/mapping/MappedSuperclass.java deleted file mode 100644 index 236da75c8..000000000 --- a/jnosql-mapping/jnosql-mapping-api-core/src/main/java/org/eclipse/jnosql/mapping/MappedSuperclass.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2023 Contributors to the Eclipse Foundation - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * and Apache License v2.0 which accompanies this distribution. - * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html - * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. - * - * You may elect to redistribute this code under either of these licenses. - * - * Contributors: - * - * Otavio Santana - */ -package org.eclipse.jnosql.mapping; - - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Designates a class whose mapping information is applied to the entities that inherit from it. - * A mapped superclass has no separate table defined for it. - */ -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.TYPE) -public @interface MappedSuperclass { - -}