-
Notifications
You must be signed in to change notification settings - Fork 9
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
Added initial support for Composite Foreign Keys and Indexes #19
base: master
Are you sure you want to change the base?
Conversation
List<ForeignKey> foreignKeyList = table.getForeignKeys(); | ||
for (ForeignKey foreignKey : foreignKeyList) | ||
{ | ||
StringBuilder sb_FK = new StringBuilder(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you split out the building of sb_FK into a separate method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, no problem
/Adrian
The PR looks good mate, could you also add a README on how to use the composites though? For examples of how I was testing whether indexes were created successfully. Cheers, |
…onstraints and Triggers
…ellian/SQLKing.git into feature/composite_indexes_fks # Conflicts: # client/build.gradle # common/pom.xml # common/src/main/java/com/memtrip/sqlking/common/Column.java # common/src/main/java/com/memtrip/sqlking/common/ForeignKey.java # common/src/main/java/com/memtrip/sqlking/common/Index.java # common/src/main/java/com/memtrip/sqlking/common/IndexColumn.java # common/src/main/java/com/memtrip/sqlking/common/RIRule.java # common/src/main/java/com/memtrip/sqlking/common/SortOrder.java # common/src/main/java/com/memtrip/sqlking/common/Table.java # preprocessor/pom.xml # preprocessor/src/main/java/com/memtrip/sqlking/preprocessor/processor/Processor.java # preprocessor/src/main/java/com/memtrip/sqlking/preprocessor/processor/data/Column.java # preprocessor/src/main/java/com/memtrip/sqlking/preprocessor/processor/data/Data.java # preprocessor/src/main/java/com/memtrip/sqlking/preprocessor/processor/data/ForeignKey.java # preprocessor/src/main/java/com/memtrip/sqlking/preprocessor/processor/data/Index.java # preprocessor/src/main/java/com/memtrip/sqlking/preprocessor/processor/data/IndexColumn.java # preprocessor/src/main/java/com/memtrip/sqlking/preprocessor/processor/data/Table.java # preprocessor/src/main/java/com/memtrip/sqlking/preprocessor/processor/data/parse/ParseColumnAnnotation.java # preprocessor/src/main/java/com/memtrip/sqlking/preprocessor/processor/data/parse/ParseTableAnnotation.java # preprocessor/src/main/java/com/memtrip/sqlking/preprocessor/processor/freemarker/DataModel.java # preprocessor/src/main/java/com/memtrip/sqlking/preprocessor/processor/freemarker/method/AssembleCreateIndexesMethod.java # preprocessor/src/main/java/com/memtrip/sqlking/preprocessor/processor/freemarker/method/AssembleCreateTableMethod.java # preprocessor/src/main/resources/Q.java # preprocessor/src/test/java/com/memtrip/sqlking/preprocessor/User.java
Hi Sam, I've added a few new features, including Table and Column constraints and Triggers. Also added some basic testing for Foreign Keys. Please take a peek at it and give me your feedback, I'm hoping that I'm going in the direction you were planning on. Thanks, |
@@ -101,7 +101,7 @@ public void testMultipleInsert() { | |||
}; | |||
|
|||
// exercise | |||
Insert.getBuilder().values(users).execute(getSQLProvider()); | |||
Insert.getBuilder().values((Object[])users).execute(getSQLProvider()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the cast to Object[] required?
Its looking good mate, I will make a code formatter for us to use though so its consistent. I added one other comment. Cheers, |
I'm not sure... the compiler complained about not having it, so I added it, and it worked. On 26 Sep 2016 12:02, Samuel Kirton wrote:
|
Thanks for the code formatter, I've been using the other method for years, and I keep /Adrian On 26 Sep 2016 12:03, Samuel Kirton wrote:
|
Added a windows-based build-allw.cmd file
…tions for Primary Keys, Foreign Keys, Indexes, Triggers and Constraints
ps. I also added some debug statements to the preprocessor project
Hi Sam, Added and cleaned up, sorry, I forgot to create a new branch before adding the Trigger and Constraint annotations. Please take a peek and let me know what you think. I still need to create some examples for the Trigger annotations in the Preprocessor tests, and create the necessary client tests, but I'm running very short on time at the moment. Thanks, |
Thanks for the contribution Adrian, its really nice, could you run the default Intellji formatter over the code? I will then squash the commit and rebase it with master. |
…ign key syntax was not being generated properly
Hi Adrian, Is this pull request ready to get merged? I will reformat your code before rebasing it into master, so let me know if you need to add any more changes. Thanks again for your contribution. Cheers, |
Hi Sam,
My first PR of reasonable size. I'm new to this so please bear with me. Any and all feedback and criticism is very welcome.
Thanks for this awesome project, btw. Your mixing of FreeMarker with the APT is a stroke of genius IMO.
Regards,
Adrian