-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Conversation
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.
Please add tests for this feature.
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.
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 { |
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.
blank line is probably needed above
*/ | ||
private static String getColumnName(Part part, Class<?> domainType) { | ||
PropertyPath prperty = part.getProperty(); | ||
if (prperty.getType() != domainType) |
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.
blank line
* */ | ||
public class IgniteSpringDataCompoundKeyTest extends GridCommonAbstractTest { | ||
|
||
/** Application context */ |
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.
blank line NOT needed at the start of class
*/ | ||
@Override protected void beforeTestsStarted() throws Exception { | ||
super.beforeTestsStarted(); | ||
ctx = new AnnotationConfigApplicationContext(); |
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.
blank line
ctx = new AnnotationConfigApplicationContext(); | ||
ctx.register(CompoundKeyApplicationConfiguration.class); | ||
ctx.refresh(); | ||
repo = ctx.getBean(CityRepository.class); |
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.
blank line
* */ | ||
@Override protected void beforeTest() throws Exception { | ||
super.beforeTest(); | ||
loadData(); |
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.
blank line above and below
/** load data*/ | ||
public void loadData() throws Exception { | ||
Ignite ignite = ctx.getBean(Ignite.class); | ||
if (ignite.cacheNames().contains(CACHE_NAME)) |
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.
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"); |
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.
blank line above
* Value-class | ||
* */ | ||
public class City { | ||
|
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.
blank line not needed, etc
|
||
/** Compound key for city class */ | ||
public class CityKey implements Serializable { | ||
|
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.
etc, etc
In IgniteQueryGenerator added searching key fields among field of key-class.