Package sk.iway.iwcm.rag.pgvector
Class PgvectorJpaConfig
java.lang.Object
sk.iway.iwcm.rag.pgvector.PgvectorJpaConfig
@Configuration("rag:JpaDBConfig")
@EnableTransactionManagement
@EnableJpaRepositories(entityManagerFactoryRef="ragEntityManager",
transactionManagerRef="ragTransactionManager",
basePackages="sk.iway.iwcm.rag.pgvector")
public class PgvectorJpaConfig
extends Object
JPA configuration for RAG pgvector entities.
Uses either the primary DB (if it's PostgreSQL) or a secondary 'rag_jpa' datasource.
If no pgvector-capable DB is available, this config is effectively unused.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.orm.jpa.LocalContainerEntityManagerFactoryBeanCreate the JPA EntityManagerFactory for RAG entities.static StringReturns the datasource name for RAG pgvector operations.static booleanCheck if RAG vector store is available (pgvector-capable DB configured).org.springframework.transaction.PlatformTransactionManagerCreate the JPA transaction manager for RAG entities.
-
Constructor Details
-
PgvectorJpaConfig
public PgvectorJpaConfig()
-
-
Method Details
-
transactionManager
@Bean("ragTransactionManager") public org.springframework.transaction.PlatformTransactionManager transactionManager()Create the JPA transaction manager for RAG entities. -
entityManagerFactory
@Bean("ragEntityManager") public org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean entityManagerFactory()Create the JPA EntityManagerFactory for RAG entities. Uses the RAG datasource if available, otherwise falls back to the default 'iwcm' datasource. -
getRagDataSourceName
Returns the datasource name for RAG pgvector operations. If a secondary 'rag_jpa' datasource exists, use it. Otherwise, if primary DB is PostgreSQL, use 'iwcm', because it can run pgvector extension. Otherwise return null (RAG not available). -
isRagAvailable
public static boolean isRagAvailable()Check if RAG vector store is available (pgvector-capable DB configured).
-