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

feat: Add interfaces for CRUD services #20743

Merged
merged 36 commits into from
Jan 13, 2025
Merged
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
9f5c5ec
feat: Add interfaces for CRUD services
Artur- Dec 18, 2024
8ebca25
Move jpa related classes into separate package
Artur- Dec 18, 2024
ffbdff0
format
Artur- Dec 18, 2024
e840b56
Changes VS Code left unsaved
Artur- Dec 18, 2024
a32c1ff
Make JpaFilterConverter work without the EntityManager.
peholmst Dec 18, 2024
7fd7590
Leave out FilterTransformer as it is not used anywhere
Artur- Dec 18, 2024
2f7a5db
Simplify as JpaFilterConverter now only has one helper method
Artur- Dec 18, 2024
fcaf974
Tests from Hilla
Artur- Dec 18, 2024
5a2d557
Add missing dependencies to make Spring Data tests work.
peholmst Dec 18, 2024
14d7d87
Change expected exception
Artur- Dec 18, 2024
94436bf
fix test
Artur- Dec 18, 2024
c1a9062
final
Artur- Dec 18, 2024
b00f394
Use jspecify instead of custom annotations
Artur- Dec 18, 2024
5163a3c
Util class not serializable
Artur- Dec 18, 2024
7645905
format
Artur- Dec 18, 2024
9d55027
Merge branch 'main' into crud-interfaces
Artur- Dec 18, 2024
2b8b150
For Hilla compat
Artur- Dec 18, 2024
8a9f6b6
fix test
Artur- Dec 18, 2024
230bbc5
Tweak
Artur- Dec 19, 2024
463bffb
Merge branch 'main' into crud-interfaces
Artur- Dec 19, 2024
10e9ead
Remove nullable
Artur- Dec 19, 2024
a032f73
Merge remote-tracking branch 'origin/main' into crud-interfaces
Artur- Dec 19, 2024
57ec343
Refactor to be more understandable and overrideable/extendable
Artur- Dec 20, 2024
9663c01
Merge branch 'main' into crud-interfaces
Artur- Dec 20, 2024
2cb9676
Fix test
Artur- Dec 20, 2024
3f9f7fe
format
Artur- Dec 20, 2024
0807c0f
Merge branch 'main' into crud-interfaces
Artur- Dec 20, 2024
5c83fcd
Merge branch 'main' into crud-interfaces
Artur- Jan 3, 2025
250212a
Merge branch 'main' into crud-interfaces
Artur- Jan 13, 2025
c272a43
Add convenience constructors
Artur- Jan 13, 2025
72f6548
Improve javadoc
Artur- Jan 13, 2025
9fa935e
Improve javadoc
Artur- Jan 13, 2025
98bee66
javadoc
Artur- Jan 13, 2025
c16124f
Add count()
Artur- Jan 13, 2025
ce450df
Revert "Add count()"
Artur- Jan 13, 2025
961675c
format
Artur- Jan 13, 2025
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
Prev Previous commit
Next Next commit
Add convenience constructors
  • Loading branch information
Artur- committed Jan 13, 2025
commit c272a4355a7d16ce36068afdffea43a40e05a8bf
Original file line number Diff line number Diff line change
@@ -9,8 +9,26 @@
* filters and verifying that all of them pass.
*/
public class AndFilter extends Filter {

private List<Filter> children;

/**
* Create an empty filter.
*/
public AndFilter() {
// Empty constructor is needed for serialization
}

/**
* Create a filter with the given children.
*
* @param children
* the children of the filter
*/
public AndFilter(Filter... children) {
setChildren(List.of(children));
}

public List<Filter> getChildren() {
return children;
}
@@ -21,7 +39,7 @@ public void setChildren(List<Filter> children) {

@Override
public String toString() {
return "AndFilter [children=" + children + "]";
return getClass().getSimpleName()+" [children=" + children + "]";
}

}
Original file line number Diff line number Diff line change
@@ -12,6 +12,23 @@ public class OrFilter extends Filter {

private List<Filter> children;

/**
* Create an empty filter.
*/
public OrFilter() {
// Empty constructor is needed for serialization
}

/**
* Create a filter with the given children.
*
* @param children
* the children of the filter
*/
public OrFilter(Filter... children) {
setChildren(List.of(children));
}

public List<Filter> getChildren() {
return children;
}
@@ -22,7 +39,7 @@ public void setChildren(List<Filter> children) {

@Override
public String toString() {
return "OrFilter [children=" + children + "]";
return getClass().getSimpleName() + " [children=" + children + "]";
}

}
Original file line number Diff line number Diff line change
@@ -24,6 +24,32 @@ public enum Matcher {
private String filterValue;
private Matcher matcher;

/**
* Create an empty filter.
*/
public PropertyStringFilter() {
// Empty constructor is needed for serialization
}

/**
* Create a filter with the given property, matcher and filter value.
*
* @param propertyId
* the property id, or a nested property path where each
* property is separated by a dot
* @param matcher
* the matcher to use when comparing the property value to the
* filter value
* @param filterValue
* the filter value to compare against
*/
public PropertyStringFilter(String propertyId, Matcher matcher,
String filterValue) {
this.propertyId = propertyId;
this.matcher = matcher;
this.filterValue = filterValue;
}

/**
* Gets the property, or nested property path, to filter by. For example
* {@code "name"} or {@code "address.city"}.
@@ -91,8 +117,8 @@ public void setMatcher(Matcher type) {

@Override
public String toString() {
return "PropertyStringFilter [propertyId=" + propertyId + ", matcher="
+ matcher + ", filterValue=" + filterValue + "]";
return getClass().getSimpleName() + " [propertyId=" + propertyId
+ ", matcher=" + matcher + ", filterValue=" + filterValue + "]";
}

}
Rate limit · GitHub

Access has been restricted

You have triggered a rate limit.

Please wait a few minutes before you try again;
in some cases this may take up to an hour.