Skip to content

Commit

Permalink
Issue #931 Use separate package for Restrictions
Browse files Browse the repository at this point in the history
Signed-off-by: Nathan Rauh <[email protected]>
  • Loading branch information
njr-11 committed Jan 7, 2025
1 parent 6c31186 commit e21f832
Show file tree
Hide file tree
Showing 20 changed files with 52 additions and 48 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.restrict.Restrict;
import jakarta.data.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.restrict.Restrict;
import jakarta.data.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.restrict.Restrict;
import jakarta.data.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.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.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.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.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.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.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.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.restrict;

public interface TextRestriction<T> extends BasicRestriction<T> {
TextRestriction<T> ignoreCase();
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.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 @@ -1072,6 +1072,7 @@
exports jakarta.data.page;
exports jakarta.data.page.impl;
exports jakarta.data.repository;
exports jakarta.data.restrict;
exports jakarta.data.exceptions;
opens jakarta.data.repository;
exports jakarta.data.spi;
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.restrict.BasicRestriction;
import jakarta.data.restrict.Operator;
import jakarta.data.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.restrict.BasicRestriction;
import jakarta.data.restrict.CompositeRestriction;
import jakarta.data.restrict.Operator;
import jakarta.data.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.restrict.Operator;
import jakarta.data.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.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.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.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.restrict;

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

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

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

Expand Down

0 comments on commit e21f832

Please sign in to comment.