Skip to content

Commit

Permalink
chore: Deprecate Hilla CRUD classes and recommend Flow ones
Browse files Browse the repository at this point in the history
  • Loading branch information
Artur- committed Dec 20, 2024
1 parent f875edb commit 3880eb2
Show file tree
Hide file tree
Showing 14 changed files with 64 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/java/endpoint/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@
<groupId>com.vaadin</groupId>
<artifactId>flow-server</artifactId>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-spring</artifactId>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>hilla-engine-core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
/**
* A browser-callable service that can count the given type of objects with a
* given filter.
*
* @deprecated Use {@link com.vaadin.flow.spring.data.CountService} instead
*/
@Deprecated(forRemoval = true)
public interface CountService {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
/**
* A browser-callable service that delegates crud operations to a JPA
* repository.
*
* @deprecated Use {@link com.vaadin.flow.spring.data.jpa.CrudRepositoryService}
* instead
*/
@Deprecated(forRemoval = true)
@EndpointExposed
public class CrudRepositoryService<T, ID, R extends CrudRepository<T, ID> & JpaSpecificationExecutor<T>>
extends ListRepositoryService<T, ID, R> implements CrudService<T, ID> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
/**
* A browser-callable service that can create, read, update, and delete a given
* type of object.
*
* @deprecated Use {@link com.vaadin.flow.spring.data.CrudService} instead
*/
@Deprecated(forRemoval = true)
public interface CrudService<T, ID> extends ListService<T>, FormService<T, ID> {
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@

/**
* A browser-callable service that can fetch the given type of object.
*
* @deprecated Use {@link com.vaadin.flow.spring.data.GetService} instead
*/
@Deprecated(forRemoval = true)
public interface GetService<T, ID> {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
* filter specifications. This class can be used to implement filtering for
* custom {@link ListService} or {@link CrudService} implementations that use
* JPA as the data source.
*
* @deprecated Use {@link com.vaadin.flow.spring.data.jpa.JpaFilterConverter}
* instead
*/
@Deprecated(forRemoval = true)
public final class JpaFilterConverter {

private JpaFilterConverter() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@
/**
* A browser-callable service that delegates list operations to a JPA
* repository.
*
* @deprecated Use {@link com.vaadin.flow.spring.data.jpa.ListRepositoryService}
* instead
*/
@Deprecated(forRemoval = true)
@EndpointExposed
public class ListRepositoryService<T, ID, R extends CrudRepository<T, ID> & JpaSpecificationExecutor<T>>
implements ListService<T>, GetService<T, ID>, CountService {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@

/**
* A browser-callable service that can list the given type of object.
*
* @deprecated Use {@link com.vaadin.flow.spring.data.ListService} instead
*/
@Deprecated(forRemoval = true)
public interface ListService<T> {
/**
* Lists objects of the given type using the paging, sorting and filtering
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
* <p>
* Custom filter implementations need to handle this filter by running all child
* filters and verifying that all of them pass.
*
* @deprecated Use {@link com.vaadin.flow.spring.data.filter.AndFilter} instead
*/
@Deprecated(forRemoval = true)
public class AndFilter extends Filter {
private List<Filter> children;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@
* <li>{@link PropertyStringFilter} - Matches a specific property, or nested
* property path, against a filter value, using a specific operator.</li>
* </ul>
*
* @deprecated Use {@link com.vaadin.flow.spring.data.filter.Filter} instead
*/
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY)
@JsonSubTypes({ @Type(value = OrFilter.class, name = "or"),
@Type(value = AndFilter.class, name = "and"),
@Type(value = PropertyStringFilter.class, name = "propertyString") })
@Deprecated(forRemoval = true)
public class Filter {

}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
* <p>
* Custom filter implementations need to handle this filter by running all child
* filters and verifying that at least one of them passes.
*
* @deprecated Use {@link com.vaadin.flow.spring.data.filter.OrFilter} instead
*/
@Deprecated(forRemoval = true)
public class OrFilter extends Filter {

private List<Filter> children;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@
* <li>Do the actual comparison using the matcher / operator provided by
* {@link #getMatcher()}</li>
* </ul>
*
* @deprecated Use
* {@link com.vaadin.flow.spring.data.filter.PropertyStringFilter}
* instead
*/
@Deprecated(forRemoval = true)
public class PropertyStringFilter extends Filter {
public enum Matcher {
EQUALS, CONTAINS, LESS_THAN, GREATER_THAN;
Expand Down
11 changes: 11 additions & 0 deletions packages/java/tests/csrf-context/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,17 @@
<artifactId>hilla</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>hilla-endpoint</artifactId>
<version>${project.version}</version>
<exclusions>
<exclusion>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-spring</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
Expand Down
11 changes: 11 additions & 0 deletions packages/java/tests/csrf/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,17 @@
<artifactId>hilla</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>hilla-endpoint</artifactId>
<version>${project.version}</version>
<exclusions>
<exclusion>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-spring</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand Down

0 comments on commit 3880eb2

Please sign in to comment.