Пример #1
0
 @Create
 public void startup(Component component) throws Exception {
   if (persistenceUnitName == null) {
     persistenceUnitName = component.getName();
   }
   entityManagerFactory = createEntityManagerFactory();
 }
 /**
  * Create ITidePersistenceManager for a PersistenceController
  *
  * @param component
  * @param controller
  * @return a ITidePersistenceManager.
  */
 public static TidePersistenceManager createTidePersistence(
     Component component, PersistenceController<?> controller) {
   TidePersistenceManager pm = TidePersistenceFactory.createTidePersistence(component, controller);
   if (pm != null) return pm;
   String controllerName = component.getName();
   if (controller.getPersistenceContext() instanceof Session)
     return new HibernatePersistenceControllerManager(controllerName);
   return null;
 }
 public void setComponent(Component component) {
   componentName = component.getName();
   this.component = component;
 }