---
title: "Arnau Aregall (@ArnauAregall) | Hashnode"
description: "Tech Lead  ☕️☁️⚙️. Read the latest articles by Arnau Aregall on Hashnode."
url: "https://hashnode.com/@ArnauAregall"
---

@ArnauAregall

# Arnau Aregall

@ArnauAregall · Catalonia, Spain · Joined March 2023

Tech Lead ☕️☁️⚙️

[Website](https://aregall.tech/)

## Comments

[Thanks for the feedback Lucas, glad you find the article useful! I did not try deploying this example to a LocalStack instance when I wrote the article. However looks like it should be possible to follow all the steps but using using awslocal and samlocal https://docs.localstack.cloud/user-guide/integrations/aws-sam/](https://hashnode.com/posts/aws-lambda-spring-cloud-function-kotlin-graalvm-native-openai/64a12c09b6330fd37c627964/comment/67a7cc626909a7ea6e8ee94c#reply-67a8f40035fcc119a22d990b)

Reply · Article · Feb 9, 2025 · [Exploring Spring Cloud Function, AWS Lambda and AI: building a native serverless application with Kotlin powered by OpenAI.](https://hashnode.com/posts/aws-lambda-spring-cloud-function-kotlin-graalvm-native-openai/64a12c09b6330fd37c627964)

[Thanks for your kind words and tip! As of Hibernate 6 it should not be needed to extend the Hibernate SQL dialect classes in order to register a FunctionContributor following the steps described in this article. If there's a specific need to define the Hibernate dialect in your project, the approach described should be compatible with the standard Hibernate dialect definition classes. spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect](https://hashnode.com/posts/hibernate-6-custom-functions/6528e89bfade2f3801c64e31/comment/668c1895332b280cb7c27aed#reply-669b502441aa0840b96a6875)

Reply · Article · Jul 20, 2024 · [Hibernate 6: custom SQL functions in Spring Data JPA repositories](https://hashnode.com/posts/hibernate-6-custom-functions/6528e89bfade2f3801c64e31)

[Thanks for your comment! If I got it correctly, you would like to handle that your custom SQL functions returns an array. Then you could register your function with your aimed return type with a BasicTypeReference instance. private static final BasicTypeReference<String\[\]> RETURN\_TYPE = new BasicTypeReference<>("string\[\]", String\[\].class, SqlTypes.ARRAY); As an example, a function called array\_first\_and\_last that gets the first and last elements of the array would be somehow like this in the post example: select array\[p.tags\[1\], p.tags\[array\_length(p.tags, 1)\]\] from products p where ... After a correct registering and rendering implementation, you should be able to use it in a JPA repository as follows: @Query("select array\_first\_and\_last(p.tags) as array from Product p where p.sku = :sku") String\[\] getFirstAndLastTagsBySku(@\\Param("sku") String sku); Hope it helps! Cheers 👍](https://hashnode.com/posts/hibernate-6-custom-functions/6528e89bfade2f3801c64e31/comment/654d202e648458030f2f3bc8#reply-654de64f5bb6e20fe50a3150)

Reply · Article · Nov 10, 2023 · [Hibernate 6: custom SQL functions in Spring Data JPA repositories](https://hashnode.com/posts/hibernate-6-custom-functions/6528e89bfade2f3801c64e31)

[Thank you! Glad you find it useful, this small feedback means a lot to me. Cheers! 👍](https://hashnode.com/posts/hibernate-6-custom-functions/6528e89bfade2f3801c64e31/comment/6529ab4f069d0e037f9a7d58#reply-652b748f900df10a392611b3)

Reply · Article · Oct 15, 2023 · [Hibernate 6: custom SQL functions in Spring Data JPA repositories](https://hashnode.com/posts/hibernate-6-custom-functions/6528e89bfade2f3801c64e31)
