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

IGNITE-13028 Spring Data integration introspects the fields of the key object #8328

Closed
wants to merge 4 commits into from

Conversation

aries-3
Copy link
Contributor

@aries-3 aries-3 commented Oct 8, 2020

In IgniteQueryGenerator added searching key fields among field of key-class.

Copy link
Contributor

@alamar alamar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add tests for this feature.

Copy link
Contributor

@alamar alamar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change looks good, but there are some formatting issues.

Please fix them to learn how we structure code newline-wise.

Please consult https://cwiki.apache.org/confluence/display/IGNITE/Coding+Guidelines#CodingGuidelines-Whitespacesandemptylines

@@ -39,7 +41,13 @@ private IgniteQueryGenerator() {
* @return Generated ignite query.
*/
public static IgniteQuery generateSql(Method mtd, RepositoryMetadata metadata) {
PartTree parts = new PartTree(mtd.getName(), metadata.getDomainType());
PartTree parts;
try {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blank line is probably needed above

*/
private static String getColumnName(Part part, Class<?> domainType) {
PropertyPath prperty = part.getProperty();
if (prperty.getType() != domainType)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blank line

* */
public class IgniteSpringDataCompoundKeyTest extends GridCommonAbstractTest {

/** Application context */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blank line NOT needed at the start of class

*/
@Override protected void beforeTestsStarted() throws Exception {
super.beforeTestsStarted();
ctx = new AnnotationConfigApplicationContext();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blank line

ctx = new AnnotationConfigApplicationContext();
ctx.register(CompoundKeyApplicationConfiguration.class);
ctx.refresh();
repo = ctx.getBean(CityRepository.class);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blank line

* */
@Override protected void beforeTest() throws Exception {
super.beforeTest();
loadData();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blank line above and below

/** load data*/
public void loadData() throws Exception {
Ignite ignite = ctx.getBean(Ignite.class);
if (ignite.cacheNames().contains(CACHE_NAME))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blank line above


try (Connection conn = DriverManager.getConnection("jdbc:ignite:thin://127.0.0.1/")) {
Statement st = conn.createStatement();
st.execute("DROP TABLE IF EXISTS City");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blank line above

* Value-class
* */
public class City {

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blank line not needed, etc


/** Compound key for city class */
public class CityKey implements Serializable {

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

etc, etc

@asfgit asfgit closed this in 0eb9b03 Oct 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants