Simple annotation processor which generates Repository implementation
Out of the box, the test suite runs a Docker container using TestContainers.
<dependency>
<groupId>com.github.longdt</groupId>
<artifactId>vertx-orm-codegen</artifactId>
<version>2.2.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.github.longdt</groupId>
<artifactId>vertx-orm-postgresql</artifactId>
<version>2.3.2</version>
</dependency>
@Entity
public class RuleTemplate {
@Id
@GeneratedValue
private Integer id;
private String name;
@Convert(converter = ArguementsConverter.class)
private Map<String, ArgumentDescription> arguments;
private String flinkJob;
private boolean active;
private LocalDateTime createdAt;
private LocalDateTime updatedAt;
...
setter/getter methods
...
}
@Repository
public interface RuleTemplateRepository extends CrudRepository<Integer, RuleTemplate> {
}
Now it time to compile project via maven command: mvn compile
.
The repository implementation will be generated: RuleTemplateRepositoryPostgres
RuleTemplateRepository repository = new RuleTemplateRepositoryPostgres(pool);