Skip to content

Commit

Permalink
feat: Automatically register a custom JpaFilterConverter if none is p…
Browse files Browse the repository at this point in the history
…resent
  • Loading branch information
Artur- committed Dec 18, 2024
1 parent ffbdff0 commit bd81a3b
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
*/
package com.vaadin.flow.spring;

import jakarta.persistence.EntityManager;
import jakarta.servlet.MultipartConfigElement;

import java.util.HashMap;
import java.util.Map;

Expand All @@ -37,10 +40,9 @@

import com.vaadin.flow.server.Constants;
import com.vaadin.flow.server.VaadinServlet;
import com.vaadin.flow.spring.data.jpa.JpaFilterConverter;
import com.vaadin.flow.spring.springnative.VaadinBeanFactoryInitializationAotProcessor;

import jakarta.servlet.MultipartConfigElement;

/**
* Spring boot auto-configuration class for Flow.
*
Expand Down Expand Up @@ -142,4 +144,11 @@ public ServerEndpointExporter websocketEndpointDeployer() {
return new VaadinWebsocketEndpointExporter();
}

@Bean
@ConditionalOnMissingBean
@ConditionalOnClass(EntityManager.class)
public JpaFilterConverter jpaFilterConverter(EntityManager entityManager) {
return new JpaFilterConverter(entityManager);
}

}

0 comments on commit bd81a3b

Please sign in to comment.