From 070b130ae6213e3292da5b473609bc35a734a6c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6berl?= Date: Tue, 4 Jul 2023 17:19:02 +0200 Subject: [PATCH] Smoke test for issue with JPA call from init method See https://github.com/oracle/graalvm-reachability-metadata/issues/324 --- .../com/example/data/jpa/AppInitializer.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 data/data-jpa/src/main/java/com/example/data/jpa/AppInitializer.java diff --git a/data/data-jpa/src/main/java/com/example/data/jpa/AppInitializer.java b/data/data-jpa/src/main/java/com/example/data/jpa/AppInitializer.java new file mode 100644 index 00000000..81b5051c --- /dev/null +++ b/data/data-jpa/src/main/java/com/example/data/jpa/AppInitializer.java @@ -0,0 +1,20 @@ +package com.example.data.jpa; + +import org.springframework.beans.factory.InitializingBean; +import org.springframework.stereotype.Service; + +@Service +public class AppInitializer implements InitializingBean { + + private AuthorRepository authorRepository; + + public AppInitializer(AuthorRepository authorRepository) { + this.authorRepository = authorRepository; + } + + @Override + public void afterPropertiesSet() throws Exception { + authorRepository.findByNameContainingIgnoreCase("name"); + } + +} \ No newline at end of file