EntityObjectGenerator { public static void generate(OBridgeConfiguration c) { try { String packageName = c.getRootPackageName() + "." + c.getPackages().getEntityObjects(); String outputDir = c.getSourceRoot() + "/" + packageName.replace(".", "/") + "/"; TypeDao typeDao = new TypeDao(DataSourceProvider.getDataSource(c.getJdbcUrl())); List<String> types = typeDao.getTypeList(c); for (String typeName : types) { generateEntityObject(packageName, outputDir, typeName, typeDao.getTypeAttributes(typeName, c.getSourceOwner())); } if (types.size() == 0) { generateEntityObject(packageName, outputDir, "Dummy", new ArrayList<>()); } if (OBridgeConfiguration.GENERATE_SOURCE_FOR_PLSQL_TYPES) { List<String> embeddedTypes = typeDao.getEmbeddedTypeList(c.getSourceOwner()); for (String typeName : embeddedTypes) { generateEntityObject(packageName, outputDir, typeName, typeDao.getEmbeddedTypeAttributes(typeName, c.getSourceOwner())); } } } catch (PropertyVetoException | IOException e) { throw new OBridgeException(e); } } private  EntityObjectGenerator(); static void generate(OBridgeConfiguration c);  }
@Test public void testGenerate() throws IOException, PropertyVetoException, SQLException { OBridgeConfiguration c = new OBridgeConfiguration(); c.setJdbcUrl(connectionString); c.setSourceRoot(File.createTempFile("ObjectGenerator", Long.toString(System.nanoTime())).getParentFile().toString()); c.setRootPackageName("hu.obridge.test"); c.setPackages(new Packages()); EntityObjectGenerator.generate(c); ConverterObjectGenerator.generate(c); ProcedureContextGenerator.generate(c); PackageObjectGenerator.generate(c); }