@Test public void testGetServiceTestModel() throws Exception { EntityMeta entityMeta = new EntityMeta(); entityMeta.setEntityClass(Foo.class); ServiceTestModel model = factory.getServiceTestModel(entityMeta); assertEquals("app.dicon", model.getConfigPath()); assertEquals("hoge", model.getPackageName()); assertEquals("FooServiceTest", model.getShortClassName()); assertEquals("FooService", model.getShortServiceClassName()); }
public ServiceModel getServiceModel(EntityMeta entityMeta) { ServiceModel serviceModel = new ServiceModel(); serviceModel.setPackageName(packageName); serviceModel.setShortClassName(entityMeta.getName() + serviceClassNameSuffix); serviceModel.setShortEntityClassName(entityMeta.getEntityClass() .getSimpleName()); serviceModel .setShortSuperclassName("Abstract" + serviceClassNameSuffix); serviceModel.setJdbcManagerName(jdbcManagerName); serviceModel.setJdbcManagerSetterNecessary(!DEFAULT_JDBC_MANAGER_NAME .equals(jdbcManagerName)); for (PropertyMeta idPropertyMeta : entityMeta.getIdPropertyMetaList()) { serviceModel.addIdPropertyMeta(idPropertyMeta); } if (entityMeta.hasVersionPropertyMeta()) { serviceModel.setVersionPropertyMeta(entityMeta .getVersionPropertyMeta()); } doNamesModel(serviceModel, entityMeta); doImportName(serviceModel, entityMeta); doGeneratedInfo(serviceModel, entityMeta); return serviceModel; }
ServiceModelFactoryImpl implements ServiceModelFactory { public ServiceModel getServiceModel(EntityMeta entityMeta) { ServiceModel serviceModel = new ServiceModel(); serviceModel.setPackageName(packageName); serviceModel.setShortClassName(entityMeta.getName() + serviceClassNameSuffix); serviceModel.setShortEntityClassName(entityMeta.getEntityClass() .getSimpleName()); serviceModel .setShortSuperclassName("Abstract" + serviceClassNameSuffix); serviceModel.setJdbcManagerName(jdbcManagerName); serviceModel.setJdbcManagerSetterNecessary(!DEFAULT_JDBC_MANAGER_NAME .equals(jdbcManagerName)); for (PropertyMeta idPropertyMeta : entityMeta.getIdPropertyMetaList()) { serviceModel.addIdPropertyMeta(idPropertyMeta); } if (entityMeta.hasVersionPropertyMeta()) { serviceModel.setVersionPropertyMeta(entityMeta .getVersionPropertyMeta()); } doNamesModel(serviceModel, entityMeta); doImportName(serviceModel, entityMeta); doGeneratedInfo(serviceModel, entityMeta); return serviceModel; } }
ServiceModelFactoryImpl implements ServiceModelFactory { public ServiceModel getServiceModel(EntityMeta entityMeta) { ServiceModel serviceModel = new ServiceModel(); serviceModel.setPackageName(packageName); serviceModel.setShortClassName(entityMeta.getName() + serviceClassNameSuffix); serviceModel.setShortEntityClassName(entityMeta.getEntityClass() .getSimpleName()); serviceModel .setShortSuperclassName("Abstract" + serviceClassNameSuffix); serviceModel.setJdbcManagerName(jdbcManagerName); serviceModel.setJdbcManagerSetterNecessary(!DEFAULT_JDBC_MANAGER_NAME .equals(jdbcManagerName)); for (PropertyMeta idPropertyMeta : entityMeta.getIdPropertyMetaList()) { serviceModel.addIdPropertyMeta(idPropertyMeta); } if (entityMeta.hasVersionPropertyMeta()) { serviceModel.setVersionPropertyMeta(entityMeta .getVersionPropertyMeta()); } doNamesModel(serviceModel, entityMeta); doImportName(serviceModel, entityMeta); doGeneratedInfo(serviceModel, entityMeta); return serviceModel; } ServiceModelFactoryImpl(String packageName,
            String serviceClassNameSuffix, NamesModelFactory namesModelFactory,
            boolean useNamesClass, String jdbcManagerName); }
ServiceModelFactoryImpl implements ServiceModelFactory { public ServiceModel getServiceModel(EntityMeta entityMeta) { ServiceModel serviceModel = new ServiceModel(); serviceModel.setPackageName(packageName); serviceModel.setShortClassName(entityMeta.getName() + serviceClassNameSuffix); serviceModel.setShortEntityClassName(entityMeta.getEntityClass() .getSimpleName()); serviceModel .setShortSuperclassName("Abstract" + serviceClassNameSuffix); serviceModel.setJdbcManagerName(jdbcManagerName); serviceModel.setJdbcManagerSetterNecessary(!DEFAULT_JDBC_MANAGER_NAME .equals(jdbcManagerName)); for (PropertyMeta idPropertyMeta : entityMeta.getIdPropertyMetaList()) { serviceModel.addIdPropertyMeta(idPropertyMeta); } if (entityMeta.hasVersionPropertyMeta()) { serviceModel.setVersionPropertyMeta(entityMeta .getVersionPropertyMeta()); } doNamesModel(serviceModel, entityMeta); doImportName(serviceModel, entityMeta); doGeneratedInfo(serviceModel, entityMeta); return serviceModel; } ServiceModelFactoryImpl(String packageName,
            String serviceClassNameSuffix, NamesModelFactory namesModelFactory,
            boolean useNamesClass, String jdbcManagerName); ServiceModel getServiceModel(EntityMeta entityMeta); }
ServiceModelFactoryImpl implements ServiceModelFactory { public ServiceModel getServiceModel(EntityMeta entityMeta) { ServiceModel serviceModel = new ServiceModel(); serviceModel.setPackageName(packageName); serviceModel.setShortClassName(entityMeta.getName() + serviceClassNameSuffix); serviceModel.setShortEntityClassName(entityMeta.getEntityClass() .getSimpleName()); serviceModel .setShortSuperclassName("Abstract" + serviceClassNameSuffix); serviceModel.setJdbcManagerName(jdbcManagerName); serviceModel.setJdbcManagerSetterNecessary(!DEFAULT_JDBC_MANAGER_NAME .equals(jdbcManagerName)); for (PropertyMeta idPropertyMeta : entityMeta.getIdPropertyMetaList()) { serviceModel.addIdPropertyMeta(idPropertyMeta); } if (entityMeta.hasVersionPropertyMeta()) { serviceModel.setVersionPropertyMeta(entityMeta .getVersionPropertyMeta()); } doNamesModel(serviceModel, entityMeta); doImportName(serviceModel, entityMeta); doGeneratedInfo(serviceModel, entityMeta); return serviceModel; } ServiceModelFactoryImpl(String packageName,
            String serviceClassNameSuffix, NamesModelFactory namesModelFactory,
            boolean useNamesClass, String jdbcManagerName); ServiceModel getServiceModel(EntityMeta entityMeta);  }