@Override public void init(IEditorSite site, IEditorInput input) throws PartInitException { EmpresaEditorInput eei = (EmpresaEditorInput) input; empresaHandler.setEmpresa(empresaHandler.findEmpresa(eei.getEmpresa().getId())); setSite(site); setInput(eei); }
private static void init() { properties.put(PersistenceUnitProperties.TARGET_DATABASE, TargetDatabase.PostgreSQL); properties.put(PersistenceUnitProperties.JDBC_DRIVER, Driver.class.getCanonicalName()); properties.put(PersistenceUnitProperties.JDBC_URL,"jdbc:postgresql://127.0.0.1:5432/ecf"); properties.put(PersistenceUnitProperties.JDBC_USER, "postgres"); properties.put(PersistenceUnitProperties.JDBC_PASSWORD, "adminadmin"); properties.put(PersistenceUnitProperties.CONNECTION_POOL_MIN, "5"); properties.put(PersistenceUnitProperties.CONNECTION_POOL_MAX, "10"); properties.put(PersistenceUnitProperties.CACHE_SHARED_DEFAULT,"false"); properties.put(PersistenceUnitProperties.CACHE_STATEMENTS,"false"); properties.put(PersistenceUnitProperties.BATCH_WRITING, "JDBC"); properties.put(PersistenceUnitProperties.CLASSLOADER, Bootstrap.class.getClassLoader()); // Cria tabelas novas (mas não atualiza) // properties.put(PersistenceUnitProperties.DDL_GENERATION, "create-tables"); properties.put("eclipselink.logging.level", "FINE"); properties.put("eclipselink.logging.timestamp", "false"); properties.put("eclipselink.logging.session", "false"); properties.put("eclipselink.logging.thread", "false"); properties.put("eclipselink.logging.exceptions", "true"); emf = new PersistenceProvider().createEntityManagerFactory("ecf", properties);