-
Notifications
You must be signed in to change notification settings - Fork 69
860 sql files generation #1570
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
Open
quantumfate
wants to merge
46
commits into
devonfw:master
Choose a base branch
from
quantumfate:860_SQL_files_generation
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
860 sql files generation #1570
Changes from 38 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 c01b3f2
Refactored Util classes, implemented sql util functions
quantumfate d560494
removed .classpath from tracking
quantumfate e0f1759
Helper function mapJavaToSqlType(String canonicalTypeName) implemented
quantumfate feaca19
Added a function that allows to retrieve annotations
quantumfate 49fa75e
Added a new dependency for SQL specific annotations, almost finished …
quantumfate 609680b
Implemented Varchar, Not Null and Auto Increment annotation
quantumfate 0fc0c2a
Functions for non collections
quantumfate 13df6ad
Implemented Foreign Key Functions and template
quantumfate 9c3cc26
Improved javadoc, implemented mappedby aspect into foreignkey method,…
quantumfate d6678f4
Implemented getSImpleSQLtype and Primary key methods
quantumfate d4d3027
Added a default parameter to getForeignKeyData and fixed bug in getFo…
quantumfate 5b05bd6
getForeignKeyStatement and template - added Test class for SQL Util
quantumfate 2acc7a1
Testclass for SQL
quantumfate a6b1613
Added test classes
quantumfate 97b1c8b
Added test cases and refined getsimplesql statement
quantumfate 90ec972
More tests
quantumfate 4379a54
Implemented utility tests and refined methods
quantumfate 6c70fe1
Primary key method refined and tests implemented
quantumfate ae8c287
Primary key tests
quantumfate cb31316
Foreign Key methods
quantumfate 8046981
implemented isFieldEntity
quantumfate 8fcf90e
Merge branch 'master' of github.com:devonfw/cobigen into 860_SQL_file…
quantumfate 08327c6
comments nad pulled upstream master
quantumfate 03dc464
- Added JavaPlugin dependency to template project for testing purposes
Lur1an dcd7f0a
Finished blueprint for template
Lur1an 7baaebd
Implemented most functionality for template generation. Tests are lac…
Lur1an 59e2da5
Simplified usage of AbstractJavaTemplateTest.
Lur1an 87c7afd
Merge branch 'master' into 860_SQL_files_generation
Lur1an 8e7a6e0
Fixes to Nullable and Unique constraint parsing for @Column and @Join…
Lur1an 8ab95ab
Fixed logic error pertaining @OneToMany and @ManyToOne annotations
Lur1an b480ef0
#860 Added first tests for sql generation
Zylesto 5008c4e
#860 added more tests, fixed bugs
Zylesto c7e1879
Implemented parsing of @JoinTable annotation into a separate inline S…
Lur1an 568760b
- Removed some unneccessary Blob/Clob logic
Lur1an 1da70f4
Adressing change-request:
Lur1an 68d01a8
Removed unneccessary comments and added javadoc to test
Lur1an 91e996e
added jdoc to getValue() method in SQLUtil
Lur1an a4b065f
Adressed change requests
Lur1an dbe627d
Deleted CommonUtil.java and restored JavaUtil to previous state.
Lur1an ab2c22b
Merge branch 'master' into 860_SQL_files_generation
jan-vcapgemini 32b5707
Merge branch 'master' into 860_SQL_files_generation
jan-vcapgemini 01ff76f
Merge branch 'master' into 860_SQL_files_generation
ee312fb
Merge branch 'master' into 860_SQL_files_generation
mdukhan 8cd58da
Merge branch 'master' into 860_SQL_files_generation
mdukhan ddc8b7e
no message
quantumfate File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
...mplates-devon4j/src/main/java/com/devonfw/cobigen/templates/devon4j/utils/CommonUtil.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| package com.devonfw.cobigen.templates.devon4j.utils; | ||
|
|
||
| import java.lang.reflect.Field; | ||
| import java.util.Collection; | ||
|
|
||
| import org.apache.commons.lang3.ClassUtils; | ||
| import org.slf4j.Logger; | ||
| import org.slf4j.LoggerFactory; | ||
|
|
||
| /** | ||
| * This class provides utility for all objects that inherit from it | ||
| * | ||
| */ | ||
| public class CommonUtil { | ||
|
|
||
| /** | ||
| * The constructor. | ||
| */ | ||
| public CommonUtil() { | ||
|
|
||
| // Empty for CobiGen to automatically instantiate it | ||
| } | ||
|
|
||
| /** | ||
| * Logger for this class | ||
| */ | ||
| protected static final Logger LOG = LoggerFactory.getLogger(JavaUtil.class); | ||
|
|
||
| /** | ||
| * Checks whether the class given by the full qualified name is an enum | ||
| * | ||
| * @param className full qualified class name | ||
| * @return <code>true</code> if the class is an enum, <code>false</code> otherwise | ||
| */ | ||
| public boolean isEnum(String className) { | ||
|
|
||
| try { | ||
| return ClassUtils.getClass(className).isEnum(); | ||
| } catch (ClassNotFoundException e) { | ||
| LOG.warn("{}: Could not find {}", e.getMessage(), className); | ||
| return false; | ||
| } | ||
| } | ||
|
|
||
| /** | ||
| * @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 SecurityException if the field cannot be accessed. | ||
| */ | ||
| public boolean isCollection(Class<?> pojoClass, String fieldName) throws NoSuchFieldException, SecurityException { | ||
|
|
||
| if (pojoClass == null) { | ||
| return false; | ||
| } | ||
|
|
||
| Field field = pojoClass.getDeclaredField(fieldName); | ||
| if (field == null) { | ||
| field = pojoClass.getField(fieldName); | ||
| } | ||
| if (field == null) { | ||
| return false; | ||
| } else { | ||
| return Collection.class.isAssignableFrom(field.getType()); | ||
| } | ||
|
|
||
| } | ||
|
|
||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.