Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

860 sql files generation #1570

Open
wants to merge 46 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
cb9e16d
#860 template structure and sql util class
quantumfate Aug 12, 2022
c01b3f2
Refactored Util classes, implemented sql util functions
quantumfate Aug 12, 2022
d560494
removed .classpath from tracking
quantumfate Aug 18, 2022
e0f1759
Helper function mapJavaToSqlType(String canonicalTypeName) implemented
quantumfate Aug 18, 2022
feaca19
Added a function that allows to retrieve annotations
quantumfate Aug 18, 2022
49fa75e
Added a new dependency for SQL specific annotations, almost finished …
quantumfate Aug 18, 2022
609680b
Implemented Varchar, Not Null and Auto Increment annotation
quantumfate Aug 19, 2022
0fc0c2a
Functions for non collections
quantumfate Aug 30, 2022
13df6ad
Implemented Foreign Key Functions and template
quantumfate Sep 21, 2022
9c3cc26
Improved javadoc, implemented mappedby aspect into foreignkey method,…
quantumfate Sep 23, 2022
d6678f4
Implemented getSImpleSQLtype and Primary key methods
quantumfate Sep 23, 2022
d4d3027
Added a default parameter to getForeignKeyData and fixed bug in getFo…
quantumfate Sep 26, 2022
5b05bd6
getForeignKeyStatement and template - added Test class for SQL Util
quantumfate Sep 26, 2022
2acc7a1
Testclass for SQL
quantumfate Sep 26, 2022
a6b1613
Added test classes
quantumfate Sep 27, 2022
97b1c8b
Added test cases and refined getsimplesql statement
quantumfate Oct 7, 2022
90ec972
More tests
quantumfate Oct 7, 2022
4379a54
Implemented utility tests and refined methods
quantumfate Oct 10, 2022
6c70fe1
Primary key method refined and tests implemented
quantumfate Oct 14, 2022
ae8c287
Primary key tests
quantumfate Oct 14, 2022
cb31316
Foreign Key methods
quantumfate Oct 14, 2022
8046981
implemented isFieldEntity
quantumfate Oct 25, 2022
8fcf90e
Merge branch 'master' of github.com:devonfw/cobigen into 860_SQL_file…
quantumfate Oct 28, 2022
08327c6
comments nad pulled upstream master
quantumfate Oct 28, 2022
03dc464
- Added JavaPlugin dependency to template project for testing purposes
Lur1an Nov 7, 2022
dcd7f0a
Finished blueprint for template
Lur1an Nov 7, 2022
7baaebd
Implemented most functionality for template generation. Tests are lac…
Lur1an Nov 8, 2022
59e2da5
Simplified usage of AbstractJavaTemplateTest.
Lur1an Nov 8, 2022
87c7afd
Merge branch 'master' into 860_SQL_files_generation
Lur1an Nov 8, 2022
8e7a6e0
Fixes to Nullable and Unique constraint parsing for @Column and @Join…
Lur1an Nov 8, 2022
8ab95ab
Fixed logic error pertaining @OneToMany and @ManyToOne annotations
Lur1an Nov 9, 2022
b480ef0
#860 Added first tests for sql generation
Zylesto Nov 9, 2022
5008c4e
#860 added more tests, fixed bugs
Zylesto Nov 10, 2022
c7e1879
Implemented parsing of @JoinTable annotation into a separate inline S…
Lur1an Nov 9, 2022
568760b
- Removed some unneccessary Blob/Clob logic
Lur1an Nov 10, 2022
1da70f4
Adressing change-request:
Lur1an Nov 15, 2022
68d01a8
Removed unneccessary comments and added javadoc to test
Lur1an Nov 17, 2022
91e996e
added jdoc to getValue() method in SQLUtil
Lur1an Nov 17, 2022
a4b065f
Adressed change requests
Lur1an Nov 17, 2022
dbe627d
Deleted CommonUtil.java and restored JavaUtil to previous state.
Lur1an Nov 18, 2022
ab2c22b
Merge branch 'master' into 860_SQL_files_generation
jan-vcapgemini Dec 6, 2022
32b5707
Merge branch 'master' into 860_SQL_files_generation
jan-vcapgemini Dec 6, 2022
01ff76f
Merge branch 'master' into 860_SQL_files_generation
Jan 5, 2023
ee312fb
Merge branch 'master' into 860_SQL_files_generation
mdukhan Jan 6, 2023
8cd58da
Merge branch 'master' into 860_SQL_files_generation
mdukhan Jan 9, 2023
ddc8b7e
no message
quantumfate Feb 16, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
15 changes: 15 additions & 0 deletions cobigen-templates/templates-devon4j/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,21 @@
<version>3.10.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
<version>3.0.2</version>
</dependency>
<dependency>
<groupId>com.devonfw.cobigen</groupId>
<artifactId>javaplugin</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.devonfw.cobigen</groupId>
<artifactId>tempeng-freemarker</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public JavaUtil() {

/**
* Returns the Object version of a Java primitive or the input if the input isn't a java primitive
*
*
* @param simpleType String
* @return the corresponding object wrapper type simple name of the input if the input is the name of a primitive java
* type. The input itself if not. (e.g. "int" results in "Integer")
Expand Down Expand Up @@ -62,7 +62,7 @@ public String boxJavaPrimitives(Class<?> pojoClass, String fieldName) throws NoS

if (pojoClass == null) {
throw new IllegalAccessError(
"Class object is null. Cannot generate template as it might obviously depend on reflection.");
"Class object is null. Cannot generate template as it might obviously depend on reflection.");
}

if (equalsJavaPrimitive(pojoClass, fieldName)) {
Expand Down Expand Up @@ -122,7 +122,7 @@ public boolean equalsJavaPrimitiveOrWrapper(String simpleType) {
* @throws SecurityException if the field cannot be accessed.
*/
public boolean equalsJavaPrimitive(Class<?> pojoClass, String fieldName)
throws NoSuchFieldException, SecurityException {
throws NoSuchFieldException, SecurityException {

if (pojoClass == null) {
return false;
Expand Down Expand Up @@ -169,10 +169,10 @@ public boolean equalsJavaPrimitiveIncludingArrays(String simpleType) {
* @throws SecurityException if the field cannot be accessed.
*/
public boolean equalsJavaPrimitiveIncludingArrays(Class<?> pojoClass, String fieldName)
throws NoSuchFieldException, SecurityException {
throws NoSuchFieldException, SecurityException {

return equalsJavaPrimitive(pojoClass, fieldName) || (pojoClass.getDeclaredField(fieldName).getType().isArray()
&& pojoClass.getDeclaredField(fieldName).getType().getComponentType().isPrimitive());
&& pojoClass.getDeclaredField(fieldName).getType().getComponentType().isPrimitive());
}

/**
Expand Down Expand Up @@ -206,7 +206,7 @@ public String castJavaPrimitives(String simpleType, String varName) throws Class
* @throws SecurityException if the field cannot be accessed.
*/
public String castJavaPrimitives(Class<?> pojoClass, String fieldName)
throws NoSuchFieldException, SecurityException {
throws NoSuchFieldException, SecurityException {

if (equalsJavaPrimitive(pojoClass, fieldName)) {
return String.format("((%1$s)%2$s)", boxJavaPrimitives(pojoClass, fieldName), fieldName);
Expand Down Expand Up @@ -334,7 +334,7 @@ public String getReturnType(Class<?> pojoClass, String methodName) throws NoSuch

if (pojoClass == null) {
throw new IllegalAccessError(
"Class object is null. Cannot generate template as it might obviously depend on reflection.");
"Class object is null. Cannot generate template as it might obviously depend on reflection.");
}
String s = "-";
Method method = findMethod(pojoClass, methodName);
Expand All @@ -357,11 +357,11 @@ public String getReturnType(Class<?> pojoClass, String methodName) throws NoSuch
*/
@SuppressWarnings("unchecked")
public String getReturnTypeOfMethodAnnotatedWith(Class<?> pojoClass, String annotatedClassName)
throws ClassNotFoundException {
throws ClassNotFoundException {

if (pojoClass == null) {
throw new IllegalAccessError(
"Class object is null. Cannot generate template as it might obviously depend on reflection.");
"Class object is null. Cannot generate template as it might obviously depend on reflection.");
}

Method[] methods = pojoClass.getDeclaredMethods();
Expand Down Expand Up @@ -414,7 +414,7 @@ private Method findMethod(Class<?> pojoClass, String methodName) {

if (pojoClass == null) {
throw new IllegalAccessError(
"Class object is null. Cannot generate template as it might obviously depend on reflection.");
"Class object is null. Cannot generate template as it might obviously depend on reflection.");
}
for (Method m : pojoClass.getMethods()) {
if (m.getName().equals(methodName)) {
Expand Down
Loading