Skip to content

Commit

Permalink
Support fluid QueryBuilder, QueryBean etc
Browse files Browse the repository at this point in the history
Description change from Object to QueryBean, due to the API change in Ebean for fluid SELF with QueryBuilder, QueryBean etc
  • Loading branch information
rbygrave committed Oct 18, 2024
1 parent 8f6d26f commit f306cbb
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ebean-agent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<groupId>io.ebean</groupId>
<artifactId>ebean-agent</artifactId>
<version>14.7.0</version>
<version>14.7.1</version>
<packaging>jar</packaging>

<name>ebean-agent</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,10 @@ public boolean improvedQueryBeans() {
return enhancementVersion >= 145;
}

public boolean fluidQueryBuilders() {
return enhancementVersion >= 148;
}

public ProfileLineNumberMode profileLineMode() {
return profileLineNumberMode;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,10 @@ private void addStaticInitialiser() {
mv.visitEnd();
}

boolean fluidQueryBuilders() {
return enhanceContext.fluidQueryBuilders();
}

/**
* Return true if profile location enhancement is on.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ public void visitMethodInsn(int opcode, String owner, String name, String desc,
classAdapter.log("add profile location " + fieldIdx);
}
mv.visitFieldInsn(GETSTATIC, classAdapter.className(), QP_FIELD_PREFIX + fieldIdx, "Lio/ebean/ProfileLocation;");
mv.visitMethodInsn(INVOKEVIRTUAL, owner, "setProfileLocation", "(Lio/ebean/ProfileLocation;)Ljava/lang/Object;", false);
String descriptor = classAdapter.fluidQueryBuilders()
? "(Lio/ebean/ProfileLocation;)Lio/ebean/typequery/QueryBean;"
: "(Lio/ebean/ProfileLocation;)Ljava/lang/Object;";
mv.visitMethodInsn(INVOKEVIRTUAL, owner, "setProfileLocation", descriptor, false);
mv.visitTypeInsn(CHECKCAST, owner);
}

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<groupId>io.ebean</groupId>
<artifactId>ebean-agent-reactor</artifactId>
<version>14.7.0</version>
<version>14.7.1</version>
<packaging>pom</packaging>
<name>ebean agent reactor</name>

Expand Down
2 changes: 1 addition & 1 deletion test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>io.ebean</groupId>
<artifactId>ebean-agent-reactor</artifactId>
<version>14.7.0</version>
<version>14.7.1</version>
</parent>

<artifactId>ebean-agent-test</artifactId>
Expand Down

0 comments on commit f306cbb

Please sign in to comment.