@Test public void testExecuteArtifactPairsImports() throws Exception { ObjEntity testEntity1 = new ObjEntity("TE1"); testEntity1.setClassName("org.example.TestClass1"); cgenConfiguration.setMakePairs(true); cgenConfiguration.setSuperPkg("org.example.auto"); List<String> generated = execute(new EntityArtifact(testEntity1)); assertNotNull(generated); assertEquals(2, generated.size()); String superclass = generated.get(0); assertTrue(superclass, superclass.contains("package org.example.auto;")); assertTrue(superclass, superclass.contains("import org.apache.cayenne.BaseDataObject;")); String subclass = generated.get(1); assertTrue(subclass, subclass.contains("package org.example;")); assertTrue(subclass, subclass.contains("import org.example.auto._TestClass1;")); }
public void execute() throws Exception { validateAttributes(); try { for (Artifact artifact : cgenConfiguration.getArtifacts()) { execute(artifact); } } finally { templateCache.clear(); } }
ClassGenerationAction { public void execute() throws Exception { validateAttributes(); try { for (Artifact artifact : cgenConfiguration.getArtifacts()) { execute(artifact); } } finally { templateCache.clear(); } } }
ClassGenerationAction { public void execute() throws Exception { validateAttributes(); try { for (Artifact artifact : cgenConfiguration.getArtifacts()) { execute(artifact); } } finally { templateCache.clear(); } } ClassGenerationAction(CgenConfiguration cgenConfig); }
ClassGenerationAction { public void execute() throws Exception { validateAttributes(); try { for (Artifact artifact : cgenConfiguration.getArtifacts()) { execute(artifact); } } finally { templateCache.clear(); } } ClassGenerationAction(CgenConfiguration cgenConfig); String defaultTemplateName(TemplateType type); String customTemplateName(TemplateType type); void resetContextForArtifact(Artifact artifact); void addEntities(Collection<ObjEntity> entities); void addEmbeddables(Collection<Embeddable> embeddables); void addQueries(Collection<QueryDescriptor> queries); void prepareArtifacts(); void execute(); void setLogger(Logger logger); CgenConfiguration getCgenConfiguration(); void setContext(Context context); void setCgenConfiguration(CgenConfiguration cgenConfiguration); ToolsUtilsFactory getUtilsFactory(); void setUtilsFactory(ToolsUtilsFactory utilsFactory); void setMetadataUtils(MetadataUtils metadataUtils); MetadataUtils getMetadataUtils(); }
ClassGenerationAction { public void execute() throws Exception { validateAttributes(); try { for (Artifact artifact : cgenConfiguration.getArtifacts()) { execute(artifact); } } finally { templateCache.clear(); } } ClassGenerationAction(CgenConfiguration cgenConfig); String defaultTemplateName(TemplateType type); String customTemplateName(TemplateType type); void resetContextForArtifact(Artifact artifact); void addEntities(Collection<ObjEntity> entities); void addEmbeddables(Collection<Embeddable> embeddables); void addQueries(Collection<QueryDescriptor> queries); void prepareArtifacts(); void execute(); void setLogger(Logger logger); CgenConfiguration getCgenConfiguration(); void setContext(Context context); void setCgenConfiguration(CgenConfiguration cgenConfiguration); ToolsUtilsFactory getUtilsFactory(); void setUtilsFactory(ToolsUtilsFactory utilsFactory); void setMetadataUtils(MetadataUtils metadataUtils); MetadataUtils getMetadataUtils(); static final String SINGLE_CLASS_TEMPLATE; static final String SUBCLASS_TEMPLATE; static final String SUPERCLASS_TEMPLATE; static final String EMBEDDABLE_SINGLE_CLASS_TEMPLATE; static final String EMBEDDABLE_SUBCLASS_TEMPLATE; static final String EMBEDDABLE_SUPERCLASS_TEMPLATE; static final String DATAMAP_SINGLE_CLASS_TEMPLATE; static final String DATAMAP_SUBCLASS_TEMPLATE; static final String DATAMAP_SUPERCLASS_TEMPLATE; static final String SUPERCLASS_PREFIX; }