Created
June 20, 2021 07:58
-
-
Save amirmv2006/e9eb826d3037354be379b62f0f75dfa8 to your computer and use it in GitHub Desktop.
Spring Native Hints for Firestore Repositories
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ir.amv.enterprise.locorepo.common.gcp.adapter; | |
import com.google.cloud.spring.autoconfigure.firestore.FirestoreRepositoriesAutoConfiguration; | |
import com.google.cloud.spring.data.firestore.SimpleFirestoreReactiveRepository; | |
import com.google.cloud.spring.data.firestore.repository.support.FirestoreRepositoryFactoryBean; | |
import org.springframework.nativex.hint.AccessBits; | |
import org.springframework.nativex.hint.JdkProxyHint; | |
import org.springframework.nativex.hint.NativeHint; | |
import org.springframework.nativex.hint.TypeHint; | |
import org.springframework.nativex.type.NativeConfiguration; | |
@NativeHint(trigger = FirestoreRepositoriesAutoConfiguration.class, | |
types = @TypeHint(types = { | |
FirestoreRepositoryFactoryBean.class, | |
SimpleFirestoreReactiveRepository.class | |
}, typeNames = { | |
"com.google.cloud.spring.data.firestore.mapping.FirestoreMappingContext" | |
}, access = AccessBits.CLASS | AccessBits.DECLARED_METHODS | AccessBits.DECLARED_CONSTRUCTORS | |
| AccessBits.RESOURCE) | |
, | |
jdkProxies = @JdkProxyHint(typeNames = { | |
"com.google.cloud.spring.data.firestore.FirestoreReactiveRepository", | |
"org.springframework.aop.SpringProxy", | |
"org.springframework.aop.framework.Advised", | |
"org.springframework.core.DecoratingProxy" | |
}) | |
) | |
public class FirestoreRepositoriesHints implements NativeConfiguration { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this class will be detected using SPI meaning the FQN name of the class should be put into a file named
org.springframework.nativex.type.NativeConfiguration
inresources/META-INF/services
.The module containing this code should be on the classpath of spring aot build. for example, when using maven: