@Test public void testGetEntityTestModel() throws Exception { EntityMeta entityMeta = new EntityMeta(); entityMeta.setName("Foo"); entityMeta.setEntityClass(getClass()); EntityTestModel entityTestModel = factory .getEntityTestModel(entityMeta); assertEquals("s2jdbc.dicon", entityTestModel.getConfigPath()); assertEquals("jdbcManager", entityTestModel.getJdbcManagerName()); assertEquals("org.seasar.extension.jdbc.gen.internal.model", entityTestModel.getPackageName()); assertEquals("FooTest", entityTestModel.getShortClassName()); assertEquals("Foo", entityTestModel.getShortEntityClassName()); assertEquals(3, entityTestModel.getImportNameSet().size()); }
public EntityModel getEntityModel(EntityDesc entityDesc) { EntityModel entityModel = new EntityModel(); if (showCatalogName) { entityModel.setCatalogName(entityDesc.getCatalogName()); } if (showSchemaName) { entityModel.setSchemaName(entityDesc.getSchemaName()); } if (showTableName) { entityModel.setTableName(entityDesc.getTableName()); } entityModel.setPackageName(packageName); entityModel.setShortClassName(entityDesc.getName()); if (superclass != null) { entityModel.setShortSuperclassName(superclass.getSimpleName()); } entityModel.setCompositeId(entityDesc.hasCompositeId()); entityModel.setUseAccessor(useAccessor); entityModel.setComment(entityDesc.getComment()); entityModel.setUseComment(useComment); doAttributeModel(entityModel, entityDesc); doAssociationModel(entityModel, entityDesc); doCompositeUniqueConstraintModel(entityModel, entityDesc); doImportName(entityModel, entityDesc); doGeneratedInfo(entityModel, entityDesc); return entityModel; }
EntityModelFactoryImpl implements EntityModelFactory { public EntityModel getEntityModel(EntityDesc entityDesc) { EntityModel entityModel = new EntityModel(); if (showCatalogName) { entityModel.setCatalogName(entityDesc.getCatalogName()); } if (showSchemaName) { entityModel.setSchemaName(entityDesc.getSchemaName()); } if (showTableName) { entityModel.setTableName(entityDesc.getTableName()); } entityModel.setPackageName(packageName); entityModel.setShortClassName(entityDesc.getName()); if (superclass != null) { entityModel.setShortSuperclassName(superclass.getSimpleName()); } entityModel.setCompositeId(entityDesc.hasCompositeId()); entityModel.setUseAccessor(useAccessor); entityModel.setComment(entityDesc.getComment()); entityModel.setUseComment(useComment); doAttributeModel(entityModel, entityDesc); doAssociationModel(entityModel, entityDesc); doCompositeUniqueConstraintModel(entityModel, entityDesc); doImportName(entityModel, entityDesc); doGeneratedInfo(entityModel, entityDesc); return entityModel; } }
EntityModelFactoryImpl implements EntityModelFactory { public EntityModel getEntityModel(EntityDesc entityDesc) { EntityModel entityModel = new EntityModel(); if (showCatalogName) { entityModel.setCatalogName(entityDesc.getCatalogName()); } if (showSchemaName) { entityModel.setSchemaName(entityDesc.getSchemaName()); } if (showTableName) { entityModel.setTableName(entityDesc.getTableName()); } entityModel.setPackageName(packageName); entityModel.setShortClassName(entityDesc.getName()); if (superclass != null) { entityModel.setShortSuperclassName(superclass.getSimpleName()); } entityModel.setCompositeId(entityDesc.hasCompositeId()); entityModel.setUseAccessor(useAccessor); entityModel.setComment(entityDesc.getComment()); entityModel.setUseComment(useComment); doAttributeModel(entityModel, entityDesc); doAssociationModel(entityModel, entityDesc); doCompositeUniqueConstraintModel(entityModel, entityDesc); doImportName(entityModel, entityDesc); doGeneratedInfo(entityModel, entityDesc); return entityModel; } EntityModelFactoryImpl(
            String packageName,
            Class<?> superclass,
            AttributeModelFactory attributeModelFactory,
            AssociationModelFactory associationModelFactory,
            CompositeUniqueConstraintModelFactory compositeUniqueConstraintModelFactory,
            boolean useAccessor, boolean useComment, boolean showCatalogName,
            boolean showSchemaName, boolean showTableName); }
EntityModelFactoryImpl implements EntityModelFactory { public EntityModel getEntityModel(EntityDesc entityDesc) { EntityModel entityModel = new EntityModel(); if (showCatalogName) { entityModel.setCatalogName(entityDesc.getCatalogName()); } if (showSchemaName) { entityModel.setSchemaName(entityDesc.getSchemaName()); } if (showTableName) { entityModel.setTableName(entityDesc.getTableName()); } entityModel.setPackageName(packageName); entityModel.setShortClassName(entityDesc.getName()); if (superclass != null) { entityModel.setShortSuperclassName(superclass.getSimpleName()); } entityModel.setCompositeId(entityDesc.hasCompositeId()); entityModel.setUseAccessor(useAccessor); entityModel.setComment(entityDesc.getComment()); entityModel.setUseComment(useComment); doAttributeModel(entityModel, entityDesc); doAssociationModel(entityModel, entityDesc); doCompositeUniqueConstraintModel(entityModel, entityDesc); doImportName(entityModel, entityDesc); doGeneratedInfo(entityModel, entityDesc); return entityModel; } EntityModelFactoryImpl(
            String packageName,
            Class<?> superclass,
            AttributeModelFactory attributeModelFactory,
            AssociationModelFactory associationModelFactory,
            CompositeUniqueConstraintModelFactory compositeUniqueConstraintModelFactory,
            boolean useAccessor, boolean useComment, boolean showCatalogName,
            boolean showSchemaName, boolean showTableName); EntityModel getEntityModel(EntityDesc entityDesc); }
EntityModelFactoryImpl implements EntityModelFactory { public EntityModel getEntityModel(EntityDesc entityDesc) { EntityModel entityModel = new EntityModel(); if (showCatalogName) { entityModel.setCatalogName(entityDesc.getCatalogName()); } if (showSchemaName) { entityModel.setSchemaName(entityDesc.getSchemaName()); } if (showTableName) { entityModel.setTableName(entityDesc.getTableName()); } entityModel.setPackageName(packageName); entityModel.setShortClassName(entityDesc.getName()); if (superclass != null) { entityModel.setShortSuperclassName(superclass.getSimpleName()); } entityModel.setCompositeId(entityDesc.hasCompositeId()); entityModel.setUseAccessor(useAccessor); entityModel.setComment(entityDesc.getComment()); entityModel.setUseComment(useComment); doAttributeModel(entityModel, entityDesc); doAssociationModel(entityModel, entityDesc); doCompositeUniqueConstraintModel(entityModel, entityDesc); doImportName(entityModel, entityDesc); doGeneratedInfo(entityModel, entityDesc); return entityModel; } EntityModelFactoryImpl(
            String packageName,
            Class<?> superclass,
            AttributeModelFactory attributeModelFactory,
            AssociationModelFactory associationModelFactory,
            CompositeUniqueConstraintModelFactory compositeUniqueConstraintModelFactory,
            boolean useAccessor, boolean useComment, boolean showCatalogName,
            boolean showSchemaName, boolean showTableName); EntityModel getEntityModel(EntityDesc entityDesc);  }