We're happy to announce the 2.5 release of Hilla. This release addresses a common question we've heard from you when it comes to the new CRUD components: what if I don't use JPA? Hilla 2.5 adds support for DTOs, which means you can now use the CRUD components with any data source.
More flexible data sources
You can now use AutoGrid
, AutoForm
, and AutoCrud
with any Java object, not only JPA entities.
ListService for AutoGrid
In order to use AutoGrid with any data type, you need to provide an implementation of ListService<T>
.
@BrowserCallable
@AnonymousAllowed
public class ProductDtoListService implements ListService<ProductDto> {
@Override
public List<ProductDto> list(Pageable pageable, @Nullable Filter filter) {
// return appropriate list of ProductDto
}
}
Read the full documentation for using ListService
.
CrudService for AutoForm and AutoCrud
In order to use AutoForm and AutoCrud with any data type, you need to provide an implementation of CrudService<T, ID>
.
@BrowserCallable
@AnonymousAllowed
public class ProductDtoCrudService implements CrudService<ProductDto, Long> {
@Override
public List<ProductDto> list(Pageable pageable, @Nullable Filter filter) {
// return appropriate list of ProductDto
}
@Override
public @Nullable ProductDto save(ProductDto value) {
// save ProductDto
}
@Override
public void delete(Long id) {
// delete ProductDto
}
}
Read the full documentation for using CrudService
.
Upgrading to Hilla 2.5
To upgrade to Hilla 2.5, update the version in your project's pom.xml file:
<properties>
<hilla.version>2.5.0</hilla.version>
</properties>
For new Hilla projects, use the CLI:
npx @hilla/cli create my-app
Full release notes
You can find the full release notes on GitHub.