diff --git a/cobigen-templates/templates-devon4j/src/main/java/com/devonfw/cobigen/templates/devon4j/utils/CommonUtil.java b/cobigen-templates/templates-devon4j/src/main/java/com/devonfw/cobigen/templates/devon4j/utils/CommonUtil.java index af5e7ad7a9..147acf64cf 100644 --- a/cobigen-templates/templates-devon4j/src/main/java/com/devonfw/cobigen/templates/devon4j/utils/CommonUtil.java +++ b/cobigen-templates/templates-devon4j/src/main/java/com/devonfw/cobigen/templates/devon4j/utils/CommonUtil.java @@ -46,7 +46,7 @@ public boolean isEnum(String className) { * @param pojoClass {@link Class} the class object of the pojo * @param fieldName {@link String} the name of the field * @return true if the field is an instance of java.utils.Collections - * @throws NoSuchFieldException indicating something awefully wrong in the used model + * @throws NoSuchFieldException indicating something awfully wrong in the used model * @throws SecurityException if the field cannot be accessed. */ public boolean isCollection(Class pojoClass, String fieldName) throws NoSuchFieldException, SecurityException { diff --git a/cobigen-templates/templates-devon4j/src/main/java/com/devonfw/cobigen/templates/devon4j/utils/SQLUtil.java b/cobigen-templates/templates-devon4j/src/main/java/com/devonfw/cobigen/templates/devon4j/utils/SQLUtil.java index 88d7dc0a7c..2c266f034c 100644 --- a/cobigen-templates/templates-devon4j/src/main/java/com/devonfw/cobigen/templates/devon4j/utils/SQLUtil.java +++ b/cobigen-templates/templates-devon4j/src/main/java/com/devonfw/cobigen/templates/devon4j/utils/SQLUtil.java @@ -20,7 +20,7 @@ public SQLUtil() { } /** - * Unwraps type to autogenerate a name for the table following devonf naming convention. + * Unwraps type to autogenerate a name for the table following devonfw naming convention. * * @param entityType String that represents the entity class type * @return parsed table name @@ -251,6 +251,8 @@ public static String mapType(String typeString) { /** * Extracts the name of the field from the Map whilst checking for name-override in @Column annotation + * @param field Dynamic map for field + * @return simple name for field as String */ static private String getFieldName(Map field) { diff --git a/cobigen-templates/templates-devon4j/src/test/java/com/devonfw/cobigen/templates/devon4j/test/templates/AbstractJavaTemplateTest.java b/cobigen-templates/templates-devon4j/src/test/java/com/devonfw/cobigen/templates/devon4j/test/templates/AbstractJavaTemplateTest.java index 52d6768844..7f94480974 100644 --- a/cobigen-templates/templates-devon4j/src/test/java/com/devonfw/cobigen/templates/devon4j/test/templates/AbstractJavaTemplateTest.java +++ b/cobigen-templates/templates-devon4j/src/test/java/com/devonfw/cobigen/templates/devon4j/test/templates/AbstractJavaTemplateTest.java @@ -1,6 +1,7 @@ package com.devonfw.cobigen.templates.devon4j.test.templates; import com.devonfw.cobigen.api.extension.TextTemplate; +import com.devonfw.cobigen.api.extension.TextTemplateEngine; import com.devonfw.cobigen.javaplugin.inputreader.JavaInputReader; import com.devonfw.cobigen.tempeng.freemarker.FreeMarkerTemplateEngine; import org.junit.Before; @@ -53,6 +54,7 @@ public Path getAbsoluteTemplatePath() { * Creates a template engine for the given template path * * @param templateFolderPath Relative path to template folder from project source root + * @return {@link TextTemplateEngine} implementation for Apache FreeMarker. */ public FreeMarkerTemplateEngine createEngine(String templateFolderPath) { diff --git a/cobigen-templates/templates-devon4j/src/test/java/com/devonfw/cobigen/templates/devon4j/test/templates/testclasses/SQLTestDataTypesEntity.java b/cobigen-templates/templates-devon4j/src/test/java/com/devonfw/cobigen/templates/devon4j/test/templates/testclasses/SQLTestDataTypesEntity.java index fab85d0204..fcf9d51637 100644 --- a/cobigen-templates/templates-devon4j/src/test/java/com/devonfw/cobigen/templates/devon4j/test/templates/testclasses/SQLTestDataTypesEntity.java +++ b/cobigen-templates/templates-devon4j/src/test/java/com/devonfw/cobigen/templates/devon4j/test/templates/testclasses/SQLTestDataTypesEntity.java @@ -66,8 +66,8 @@ public class SQLTestDataTypesEntity { @Column() private byte[] blob; - @Column() - private Class varchar2; + @Column() + private Class varchar2; @Column() private Locale varchar3; @@ -318,24 +318,21 @@ public void setBlob(byte[] blob) { this.blob = blob; } - - - - /** + /** * @return varchar2 */ - public Class getVarchar2() { + public Class getVarchar2() { - return this.varchar2; - } + return this.varchar2; + } - /** + /** * @param varchar2 new value of {@link #getvarchar2}. */ - public void setVarchar2(Class varchar2) { + public void setVarchar2(Class varchar2) { - this.varchar2 = varchar2; - } + this.varchar2 = varchar2; + } /** * @return varchar3 diff --git a/cobigen-templates/templates-devon4j/src/test/java/com/devonfw/cobigen/templates/devon4j/test/utils/SQLUtilTest.java b/cobigen-templates/templates-devon4j/src/test/java/com/devonfw/cobigen/templates/devon4j/test/utils/SQLUtilTest.java index a40208acc7..408fd62239 100644 --- a/cobigen-templates/templates-devon4j/src/test/java/com/devonfw/cobigen/templates/devon4j/test/utils/SQLUtilTest.java +++ b/cobigen-templates/templates-devon4j/src/test/java/com/devonfw/cobigen/templates/devon4j/test/utils/SQLUtilTest.java @@ -13,34 +13,15 @@ */ public class SQLUtilTest { + /** + * Tests type mappings between simple Java types and corresponding SQL types + */ @Test - public void testClassTypeMapping() { - + public void testTypeMappings() { assertThat(SQLUtil.mapType("Class")).isEqualTo("VARCHAR"); - } - - @Test - public void testByteArray() { - assertThat(SQLUtil.mapType("byte[]")).isEqualTo("BLOB"); - } - - @Test - public void testTimestamp() { - assertThat(SQLUtil.mapType("Timestamp")).isEqualTo("TIMESTAMP"); - } - - @Test - public void testTimeZone() { - assertThat(SQLUtil.mapType("TimeZone")).isEqualTo("VARCHAR"); - } - - @Test - public void testCalendar() { - assertThat(SQLUtil.mapType("Calendar")).isEqualTo("TIMESTAMP"); } - }