Spring Framework MutablePersistenceUnitInfo - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework MutablePersistenceUnitInfo class.

This code example shows how to use the following methods:getManagedClassNames, getPersistenceUnitName
public class MergingPersistenceUnitPostProcessor implements PersistenceUnitPostProcessor {
  private Map<String, List<String>> puiClasses = new HashMap<String, List<String>>();
 
  @Override 
  public void postProcessPersistenceUnitInfo(MutablePersistenceUnitInfo pui) {
    List<String> classes = puiClasses.get(pui.getPersistenceUnitName());
    if (classes == null) {
      classes = new ArrayList<String>();
      puiClasses.put(pui.getPersistenceUnitName(), classes);
    } 
    pui.getManagedClassNames().addAll(classes);
    classes.addAll(pui.getManagedClassNames());
  } 
} 
5
CodeRank
Experience pair programming with AI  Get Codota for Java