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

Change method signature #187

Merged
merged 1 commit into from
Jun 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public MyMethodInterceptor() {
}

@RuntimeType
public Object intercept(@This Object proxyObject, @Origin Method method, @AllArguments Object[] methodArgs, @SuperMethod(nullIfImpossible = true) Method superMethod) throws FMSException, InstantiationException, IllegalAccessException {
public Object intercept(@This Object proxyObject, @Origin Method method, @AllArguments Object[] methodArgs, @SuperMethod(nullIfImpossible = true) Method superMethod) throws FMSException {

if (GenerateQuery.path.get() == null) {
GenerateQuery.path.set(new Path<Object>(extractPropertyName(method), extractEntity(proxyObject)));
Expand Down Expand Up @@ -112,7 +112,7 @@ protected String extractPropertyName(Method method) {
*/
@SuppressWarnings("unchecked")
public <T> T createInstance(Object proxyObject, Method method, Object[] methodArgs, Method superMethod)
throws FMSException, InstantiationException, IllegalAccessException {
throws FMSException {
Object obj = null;
Class<?> type = method.getReturnType();
if (String.class.equals(type)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public void setCalendar() {
}

@Test
public void testQuery_datatypes() throws InstantiationException, IllegalAccessException {
public void testQuery_datatypes() {
Data data = GenerateQuery.createQueryEntity(new Data());
String query = select($(data.getStringData()), $(data.getIntData()), $(data.getByteData()), $(data.getShortData()), $(data.getLongData()),
$(data.getFloatData()), $(data.getDoubleData()), $(data.getCalendarData()), $(data.isBooleanData()), $(data.getDateData()),
Expand All @@ -69,7 +69,7 @@ public void testQuery_datatypes() throws InstantiationException, IllegalAccessEx
}

@Test
public void testQuery_eq() throws InstantiationException, IllegalAccessException {
public void testQuery_eq() {
Data data = GenerateQuery.createQueryEntity(Data.class);
String query = select($(data)).where($(data.getStringData()).eq("StringValue"), $(data.getIntData()).eq(10),
$(data.getByteData()).eq((byte) 10), $(data.getShortData()).eq((short) 10), $(data.getLongData()).eq((long) 10),
Expand All @@ -82,7 +82,7 @@ public void testQuery_eq() throws InstantiationException, IllegalAccessException
}

@Test
public void testQuery_eqUsingInvalidEnum() throws InstantiationException, IllegalAccessException {
public void testQuery_eqUsingInvalidEnum() {
Data data = GenerateQuery.createQueryEntity(Data.class);
String query = select($(data)).where($(data.getStringData()).eq("StringValue"), $(data.getIntData()).eq(10),
$(data.getByteData()).eq((byte) 10), $(data.getShortData()).eq((short) 10), $(data.getLongData()).eq((long) 10),
Expand All @@ -95,7 +95,7 @@ public void testQuery_eqUsingInvalidEnum() throws InstantiationException, Illega
}

@Test
public void testQuery_neq() throws InstantiationException, IllegalAccessException {
public void testQuery_neq() {
Data data = GenerateQuery.createQueryEntity(Data.class);
String query = select($(data))
.where($(data.getStringData()).neq("StringValue"), $(data.getIntData()).neq(10), $(data.getByteData()).neq((byte) 10),
Expand All @@ -108,7 +108,7 @@ public void testQuery_neq() throws InstantiationException, IllegalAccessExceptio
}

@Test
public void testQuery_lt() throws InstantiationException, IllegalAccessException {
public void testQuery_lt() {
Data data = GenerateQuery.createQueryEntity(Data.class);
String query = select($(data)).where($(data.getStringData()).lt("StringValue"), $(data.getIntData()).lt(10),
$(data.getByteData()).lt((byte) 10), $(data.getShortData()).lt((short) 10), $(data.getLongData()).lt((long) 10),
Expand All @@ -120,7 +120,7 @@ public void testQuery_lt() throws InstantiationException, IllegalAccessException
}

@Test
public void testQuery_lte() throws InstantiationException, IllegalAccessException {
public void testQuery_lte() {
Data data = GenerateQuery.createQueryEntity(Data.class);
String query = select($(data)).where($(data.getStringData()).lte("StringValue"), $(data.getIntData()).lte(10),
$(data.getByteData()).lte((byte) 10), $(data.getShortData()).lte((short) 10), $(data.getLongData()).lte((long) 10),
Expand All @@ -132,7 +132,7 @@ public void testQuery_lte() throws InstantiationException, IllegalAccessExceptio
}

@Test
public void testQuery_gt() throws InstantiationException, IllegalAccessException {
public void testQuery_gt() {
Data data = GenerateQuery.createQueryEntity(Data.class);
String query = select($(data)).where($(data.getStringData()).gt("StringValue"), $(data.getIntData()).gt(10),
$(data.getByteData()).gt((byte) 10), $(data.getShortData()).gt((short) 10), $(data.getLongData()).gt((long) 10),
Expand All @@ -144,7 +144,7 @@ public void testQuery_gt() throws InstantiationException, IllegalAccessException
}

@Test
public void testQuery_gte() throws InstantiationException, IllegalAccessException {
public void testQuery_gte() {
Data data = GenerateQuery.createQueryEntity(Data.class);
String query = select($(data)).where($(data.getStringData()).gte("StringValue"), $(data.getIntData()).gte(10),
$(data.getByteData()).gte((byte) 10), $(data.getShortData()).gte((short) 10), $(data.getLongData()).gte((long) 10),
Expand All @@ -156,7 +156,7 @@ public void testQuery_gte() throws InstantiationException, IllegalAccessExceptio
}

@Test
public void testQuery_in() throws InstantiationException, IllegalAccessException {
public void testQuery_in() {
Data data = GenerateQuery.createQueryEntity(Data.class);
String query = select($(data)).where($(data.getStringData()).in(new String[] { "StringValue1", "StringValue2" }),
$(data.getIntData()).in(new Integer[] { 10, 20 }), $(data.getByteData()).in(new Byte[] { 10, 20 }),
Expand All @@ -171,7 +171,7 @@ public void testQuery_in() throws InstantiationException, IllegalAccessException
}

@Test
public void testQuery_between() throws InstantiationException, IllegalAccessException {
public void testQuery_between() {
Data data = GenerateQuery.createQueryEntity(Data.class);
String query = select($(data)).where(
$(data.getStringData()).between("StringValue1", "StringValue2"),
Expand All @@ -190,7 +190,7 @@ public void testQuery_between() throws InstantiationException, IllegalAccessExce
}

@Test
public void testQuery_like() throws InstantiationException, IllegalAccessException {
public void testQuery_like() {
Data data = GenerateQuery.createQueryEntity(Data.class);
String query = select($(data)).where($(data.getStringData()).startsWith("StringValue")).generate();
String expectedQuery = "SELECT * FROM Data WHERE StringData LIKE 'StringValue%'";
Expand All @@ -209,7 +209,7 @@ public void testQuery_like() throws InstantiationException, IllegalAccessExcepti
}

@Test
public void testQuery_select() throws InstantiationException, IllegalAccessException {
public void testQuery_select() {
Data data = GenerateQuery.createQueryEntity(Data.class);
String query = select($(data.getSubData())).generate();
String expectedQuery = "SELECT SubData.* FROM Data";
Expand All @@ -218,7 +218,7 @@ public void testQuery_select() throws InstantiationException, IllegalAccessExcep
}

@Test
public void testQuery_orderby() throws InstantiationException, IllegalAccessException {
public void testQuery_orderby() {
Data data = GenerateQuery.createQueryEntity(Data.class);
String query = select($(data)).orderByAscending($(data.getStringData()), $(data.getIntData())).generate();
String expectedQuery = "SELECT * FROM Data ORDERBY StringData, IntData ASC";
Expand All @@ -234,7 +234,7 @@ public void testQuery_orderby() throws InstantiationException, IllegalAccessExce
}

@Test
public void testQuery_not() throws InstantiationException, IllegalAccessException {
public void testQuery_not() {
Data data = GenerateQuery.createQueryEntity(Data.class);
String query = select($(data)).where($(data.getIntData()).eq(10).negate()).generate();
String expectedQuery = "SELECT * FROM Data WHERE NOT IntData = '10'";
Expand All @@ -243,7 +243,7 @@ public void testQuery_not() throws InstantiationException, IllegalAccessExceptio
}

@Test
public void testQuery_pagination() throws InstantiationException, IllegalAccessException {
public void testQuery_pagination() {
Data data = GenerateQuery.createQueryEntity(Data.class);
String query = select($(data)).skip(10).generate();
String expectedQuery = "SELECT * FROM Data STARTPOSITION 11";
Expand All @@ -262,7 +262,7 @@ public void testQuery_pagination() throws InstantiationException, IllegalAccessE
}

@Test
public void testQuery_count() throws InstantiationException, IllegalAccessException {
public void testQuery_count() {
Data data = GenerateQuery.createQueryEntity(Data.class);
String query = selectCount(data).generate();
String expectedQuery = "SELECT count(*) FROM Data";
Expand All @@ -271,7 +271,7 @@ public void testQuery_count() throws InstantiationException, IllegalAccessExcept
}

@Test
public void testQuery_calendar() throws InstantiationException, IllegalAccessException {
public void testQuery_calendar() {
Data data = GenerateQuery.createQueryEntity(Data.class);

Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
Expand All @@ -292,7 +292,7 @@ public void testQuery_calendar() throws InstantiationException, IllegalAccessExc
}

@Test
public void testQuery_line() throws InstantiationException, IllegalAccessException {
public void testQuery_line() {
Invoice data = GenerateQuery.createQueryEntity(Invoice.class);
String query = select($(data.getLine())).generate();
String expectedQuery = "SELECT Line.* FROM Invoice";
Expand Down