1 Reply Latest reply on Aug 24, 2010 6:08 PM by Jeff Faath

    Programmatically configure Hibernate Search in Seam

    Jeff Faath Newbie

      I'm trying to set up Hibernate Search from entity classes in a packaged library.  Thus, I don't have access to the classes to add the proper annotations.  So, I found out you can configure Hibernate Search programmatically.  However, this requires setting a properties file when creating the EntityManagerFactory.  Here is the example from the Hibernate Search docs:


      SearchMapping mapping = new SearchMapping();
      [...]
      Map<String,String> properties = new HashMap<String,String)(1);
      properties.put( Environment.MODEL_MAPPING, mapping );
      EntityManagerFactory emf = Persistence.createEntityManagerFactory( "userPU", properties );
      



      where SearchMapping is the programmatic mapping.


      Now, because Seam internally bootstraps the EntityManagerFactory, I don't have access to the part where I add the properties file.  Or at least I don't think I do.  Is there a way to intercept the EMF creation so I can add the search mapping?  Is there another clever way to configure the search?


      Regards,


      Jeff