You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am experiencing several issues when working with the jMolecules framework in IntelliJ IDEA. These issues affect both application runtime and development experience in the IDE:
1. Run Configuration Issue:
The application fails to start unless I manually configure a “Before Launch” task in the IntelliJ run configuration to execute mvn compile. I’m unsure if I’m misconfiguring something or if this feature is not yet fully implemented. I was unable to find any relevant information about this online.
2. ByteBuddy Code Generation:
Even after configuring the “Before Launch” task, ByteBuddy fails to generate the required code for transforming associations into associated aggregate IDs. This leads to runtime failures when saving or retrieving aggregates using Spring Data JDBC. Is ByteBuddy supposed to generate this converter, or should I implement a custom converter?
I ask because I noticed the existence of AssociationResolver, and it seems its purpose is to create such a converter. However, in my project, it fails to do so. Here’s an example:
@Getter @table("test_order")
public class Order implements AggregateRoot<Order, OrderId> {
private final OrderId id;
private final Association<Customer, Customer.CustomerId> customer;
// If I use this constructor, JDBC will not be able to convert UUID into CustomerId without a custom converter
public Order(OrderId id, Association<Customer, Customer.CustomerId> customer) {
this.id = id;
this.customer = customer;
}
public Order(OrderId id, UUID customer) {
this.id = id;
this.customer = Association.forId(new Customer.CustomerId(customer));
}
public static Order of(Customer customer) {
return new Order(new OrderId(UUID.randomUUID()), customer.getId().id());
}
public record OrderId(UUID id) implements Identifier {
}
}
3. IDE Warnings:
IntelliJ still incorrectly flags errors or warnings in the code. For example, during dependency injection, it shows: "Could not autowire. No beans of 'OrderService' type found. " This happens even when I configure the “Before Launch” task in the run configuration and ByteBuddy generates the necessary beans and application actually works.
If I’m missing something, please provide resources or guidance on how to resolve these IntelliJ-specific issues. Alternatively, if there are any workarounds you can suggest, I would greatly appreciate it. I’ve spent a lot of time searching for solutions, but there doesn’t seem to be much documentation available, likely because this project is relatively new.
Thank you for your help!
The text was updated successfully, but these errors were encountered:
I am experiencing several issues when working with the jMolecules framework in IntelliJ IDEA. These issues affect both application runtime and development experience in the IDE:
1. Run Configuration Issue:
2. ByteBuddy Code Generation:
@Getter
@table("test_order")
public class Order implements AggregateRoot<Order, OrderId> {
private final OrderId id;
private final Association<Customer, Customer.CustomerId> customer;
}
3. IDE Warnings:
Here is my repo: https://github.com/bekaChichua/jmolecules-example
If I’m missing something, please provide resources or guidance on how to resolve these IntelliJ-specific issues. Alternatively, if there are any workarounds you can suggest, I would greatly appreciate it. I’ve spent a lot of time searching for solutions, but there doesn’t seem to be much documentation available, likely because this project is relatively new.
Thank you for your help!
The text was updated successfully, but these errors were encountered: