Skip to content

Commit

Permalink
Merge pull request #933 from njr-11/931-separate-package-for-restrict…
Browse files Browse the repository at this point in the history
…ions

Use separate package for Restrictions
  • Loading branch information
otaviojava authored Jan 15, 2025
2 parents 5dbfab1 + 227af78 commit 3015e7c
Show file tree
Hide file tree
Showing 20 changed files with 51 additions and 47 deletions.
6 changes: 3 additions & 3 deletions api/src/main/java/jakarta/data/metamodel/Attribute.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023,2024 Contributors to the Eclipse Foundation
* Copyright (c) 2023,2025 Contributors to the Eclipse Foundation
*
* 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,8 +19,8 @@

import java.util.Set;

import jakarta.data.Restrict;
import jakarta.data.Restriction;
import jakarta.data.metamodel.restrict.Restrict;
import jakarta.data.metamodel.restrict.Restriction;

/**
* Represents an entity attribute in the {@link StaticMetamodel}.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023,2024 Contributors to the Eclipse Foundation
* Copyright (c) 2023,2025 Contributors to the Eclipse Foundation
*
* 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,9 +17,9 @@
*/
package jakarta.data.metamodel;

import jakarta.data.Restrict;
import jakarta.data.Restriction;
import jakarta.data.Sort;
import jakarta.data.metamodel.restrict.Restrict;
import jakarta.data.metamodel.restrict.Restriction;

/**
* Represents a sortable entity attribute in the {@link StaticMetamodel}.
Expand Down
6 changes: 3 additions & 3 deletions api/src/main/java/jakarta/data/metamodel/TextAttribute.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023,2024 Contributors to the Eclipse Foundation
* Copyright (c) 2023,2025 Contributors to the Eclipse Foundation
*
* 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,9 +17,9 @@
*/
package jakarta.data.metamodel;

import jakarta.data.Restrict;
import jakarta.data.Sort;
import jakarta.data.TextRestriction;
import jakarta.data.metamodel.restrict.Restrict;
import jakarta.data.metamodel.restrict.TextRestriction;

/**
* Represents an textual entity attribute in the {@link StaticMetamodel}.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2024 Contributors to the Eclipse Foundation
* Copyright (c) 2024,2025 Contributors to the Eclipse Foundation
*
* 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,7 +15,7 @@
*
* SPDX-License-Identifier: Apache-2.0
*/
package jakarta.data;
package jakarta.data.metamodel.restrict;

public interface BasicRestriction<T> extends Restriction<T> {
String attribute();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2024 Contributors to the Eclipse Foundation
* Copyright (c) 2024,2025 Contributors to the Eclipse Foundation
*
* 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,7 +15,7 @@
*
* SPDX-License-Identifier: Apache-2.0
*/
package jakarta.data;
package jakarta.data.metamodel.restrict;

// Internal implementation class.
// The proper way for users to obtain instances is via
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2024 Contributors to the Eclipse Foundation
* Copyright (c) 2024,2025 Contributors to the Eclipse Foundation
*
* 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,7 +15,7 @@
*
* SPDX-License-Identifier: Apache-2.0
*/
package jakarta.data;
package jakarta.data.metamodel.restrict;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2024 Contributors to the Eclipse Foundation
* Copyright (c) 2024,2025 Contributors to the Eclipse Foundation
*
* 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,7 +15,7 @@
*
* SPDX-License-Identifier: Apache-2.0
*/
package jakarta.data;
package jakarta.data.metamodel.restrict;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2024 Contributors to the Eclipse Foundation
* Copyright (c) 2024,2025 Contributors to the Eclipse Foundation
*
* 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,7 +15,7 @@
*
* SPDX-License-Identifier: Apache-2.0
*/
package jakarta.data;
package jakarta.data.metamodel.restrict;

public enum Operator {
EQUAL,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2024 Contributors to the Eclipse Foundation
* Copyright (c) 2024,2025 Contributors to the Eclipse Foundation
*
* 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,7 +15,7 @@
*
* SPDX-License-Identifier: Apache-2.0
*/
package jakarta.data;
package jakarta.data.metamodel.restrict;

import java.util.List;
import java.util.Objects;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2024 Contributors to the Eclipse Foundation
* Copyright (c) 2024,2025 Contributors to the Eclipse Foundation
*
* 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,7 +15,7 @@
*
* SPDX-License-Identifier: Apache-2.0
*/
package jakarta.data;
package jakarta.data.metamodel.restrict;

public interface Restriction<T> {
Restriction<T> negate();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2024 Contributors to the Eclipse Foundation
* Copyright (c) 2024,2025 Contributors to the Eclipse Foundation
*
* 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,7 +15,7 @@
*
* SPDX-License-Identifier: Apache-2.0
*/
package jakarta.data;
package jakarta.data.metamodel.restrict;

public interface TextRestriction<T> extends BasicRestriction<T> {
TextRestriction<T> ignoreCase();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
* SPDX-License-Identifier: Apache-2.0
*/
package jakarta.data;
package jakarta.data.metamodel.restrict;

// Internal implementation class.
// The proper way for users to obtain instances is via
Expand Down
1 change: 1 addition & 0 deletions api/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -1069,6 +1069,7 @@
exports jakarta.data;
exports jakarta.data.metamodel;
exports jakarta.data.metamodel.impl;
exports jakarta.data.metamodel.restrict;
exports jakarta.data.page;
exports jakarta.data.page.impl;
exports jakarta.data.repository;
Expand Down
9 changes: 5 additions & 4 deletions api/src/test/java/jakarta/data/metamodel/AttributeTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2024 Contributors to the Eclipse Foundation
* Copyright (c) 2024,2025 Contributors to the Eclipse Foundation
*
* 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,12 +17,13 @@
*/
package jakarta.data.metamodel;

import jakarta.data.BasicRestriction;
import jakarta.data.Operator;
import jakarta.data.Restriction;
import org.assertj.core.api.SoftAssertions;
import org.junit.jupiter.api.Test;

import jakarta.data.metamodel.restrict.BasicRestriction;
import jakarta.data.metamodel.restrict.Operator;
import jakarta.data.metamodel.restrict.Restriction;

import java.util.Set;

import static org.assertj.core.api.Assertions.assertThatThrownBy;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2024 Contributors to the Eclipse Foundation
* Copyright (c) 2024,2025 Contributors to the Eclipse Foundation
*
* 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,11 +17,12 @@
*/
package jakarta.data.metamodel;

import jakarta.data.BasicRestriction;
import jakarta.data.CompositeRestriction;
import jakarta.data.Operator;
import jakarta.data.Restriction;
import jakarta.data.Sort;
import jakarta.data.metamodel.restrict.BasicRestriction;
import jakarta.data.metamodel.restrict.CompositeRestriction;
import jakarta.data.metamodel.restrict.Operator;
import jakarta.data.metamodel.restrict.Restriction;

import org.assertj.core.api.SoftAssertions;
import org.junit.jupiter.api.Test;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2024 Contributors to the Eclipse Foundation
* Copyright (c) 2024,2025 Contributors to the Eclipse Foundation
*
* 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,9 +17,10 @@
*/
package jakarta.data.metamodel;

import jakarta.data.Operator;
import jakarta.data.Sort;
import jakarta.data.TextRestriction;
import jakarta.data.metamodel.restrict.Operator;
import jakarta.data.metamodel.restrict.TextRestriction;

import org.assertj.core.api.SoftAssertions;
import org.junit.jupiter.api.Test;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2024 Contributors to the Eclipse Foundation
* Copyright (c) 2024,2025 Contributors to the Eclipse Foundation
*
* 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,7 +15,7 @@
*
* SPDX-License-Identifier: Apache-2.0
*/
package jakarta.data;
package jakarta.data.metamodel.restrict;

import org.assertj.core.api.SoftAssertions;
import org.junit.jupiter.api.Test;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2024 Contributors to the Eclipse Foundation
* Copyright (c) 2024,2025 Contributors to the Eclipse Foundation
*
* 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,7 +15,7 @@
*
* SPDX-License-Identifier: Apache-2.0
*/
package jakarta.data;
package jakarta.data.metamodel.restrict;


import org.assertj.core.api.SoftAssertions;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2024 Contributors to the Eclipse Foundation
* Copyright (c) 2024,2025 Contributors to the Eclipse Foundation
*
* 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,7 +15,7 @@
*
* SPDX-License-Identifier: Apache-2.0
*/
package jakarta.data;
package jakarta.data.metamodel.restrict;

import org.assertj.core.api.SoftAssertions;
import org.junit.jupiter.api.Test;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2024 Contributors to the Eclipse Foundation
* Copyright (c) 2024,2025 Contributors to the Eclipse Foundation
*
* 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,12 +15,12 @@
*
* SPDX-License-Identifier: Apache-2.0
*/
package jakarta.data;
package jakarta.data.metamodel.restrict;

import org.assertj.core.api.SoftAssertions;
import org.junit.jupiter.api.Test;

import jakarta.data.BasicRestrictionRecordTest.Book;
import jakarta.data.metamodel.restrict.BasicRestrictionRecordTest.Book;

import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy;

Expand Down

0 comments on commit 3015e7c

Please sign in to comment.