Closed Trellian closed 8 years ago
Not to worry, I figured it out.. (facepalm!)
@Column (index = true, foreign_key = "TblParent")
hi Adrian,
Although you can use the index / foreign_key labels, they currently do not impose the constraints. I am working on a pull request for this at the moment.
Cheers, Sam
Thanks Sam! Any ideas on an ETA?
The end of next week
Hi Sam,
I'm hoping you have had a chance to work on this? Also, do you have any comments about doing join queries?
Thanks, Adrian
Hi Adrian,
This will be ready on Monday, I will add to the example and let you know.
Cheers, Sam
Thanks Sam, looking forward to it :) /Adrian
Waiting in antici.......pation! :) /Adrian
Wednesday evening, I promise!
sorry for the slow progress, I was caught up in other work, you can see the progress in this branch: https://github.com/memtrip/SQLKing/tree/feature/foreign_key_constraints
No problem, we're all in the same boat :) If I may be so bold as to make a (selfish) suggestion, I don't use composite foreign keys, because I only ever use autoinc id fields for my primary keys. If you would like to work on the join functionality before adding support for composite FK's, I would greatly appreciate it.
Hi Sam, any news?
Hi Adrian,
Its close, tonight I will work on a way to make columns unique across joins, currently if I have a "timestamp" on both User and Log tables, the ORM mapper has no way to tell which object to set the column on!
Hi Sam, any news? Is there anything I can help with? I've been doing a bit of study on using APT, and my SQL is not bad, including writing advanced code-generation of relational and CRUD templates :)
Hi Adrian,
If you checkout and build the branch named "feature/foreign_key_constraints", you will have INNER JOIN functionality. Please see com.memtrip.sqlking.integration.InnerJoinTest for usage.
Sorry for the delay, its been a busy summer! Going forward some help would be great, SQLProvider.java and ClauseHelper.java classes are a good place to start!
Nested joins are not working yet, I will develop this before making a release to maven central.
Cheers, Sam
See the "feature/join_annotation" branch, this has more up to date changes.
Hi Sam,
I can't get the project to build in AS 2.1.2. I get the following error:
Error:Could not find com.memtrip.sqlking:common:1.0.9. Required by: com.memtrip.sqlking:client:1.0.7
even though the poml.xml for the common module says it is 1.0.9. Any ideas?
I also cannot find an example of the foreign key annotation in that branch. Is it required in order to setup for the joins?
Thanks, Adrian
Hi Adrian,
You need to run mvn clean install
on both the common and preprocessor projects to get them into your maven local. There is no need for the foreign key annotation to make a join, I will add this to the example and make a real release next week.
Cheers, Sam
Thanks Sam, that worked. However, I can't figure out how to get the 1.0.7 client into my project. I have tried importing it, but it doesn't work. What's the trick?
Thanks, Adrian
Hi Adrian,
The new version has been released, if you check the README it has the updated versions (1.1).
gradle install
on the client directory and mavenLocal()
in your build.gradle would have worked locally though.
Cheers, Sam
Also I added a inner join example to the sample project.
Cheers, Sam
Hi Sam,
What is the syntax for Foreign Key/Index annotation?
Regards, Adrian