domaframework / doma

DAO oriented database mapping framework for Java
https://doma.readthedocs.io/
Apache License 2.0
447 stars 70 forks source link

DOMA4084 error occurs when including the Embeddable class #1046

Closed uc4w6c closed 9 months ago

uc4w6c commented 9 months ago

Thank you for always developing.

Describe the bug I have the following entity and dao.

@Entity
public record EmployeeEntity(
  @Id long id, Address address){}

@Embeddable
public record Address(
  String city, String street) {}
@ConfigAutowireable
@Dao
public interface EmployeeDao {
  @Update(include = "address.city")
  Result<EmployeeEntity> update(EmployeeEntity entities);
}

The following error occurs.

[DOMA4084] The property "address.city" is not found in the entity class ...

Expected behavior I also want to use include for Embeddable classes.

Additional contextThe target code that I think should be fixed

https://github.com/domaframework/doma/blob/master/doma-processor/src/main/java/org/seasar/doma/internal/apt/meta/entity/EntityPropertyNameCollector.java#L31-L41

But I don't know how to make good code.

Also, doma-core may work without any modification. The name contained address.city when I debugged.

https://github.com/domaframework/doma/blob/e37714176e816dd1809d592bb5e02820bd741614/doma-core/src/main/java/org/seasar/doma/jdbc/query/AutoBatchModifyQuery.java#L84

nakamura-to commented 9 months ago

Thank you for your feedback. I will look into it.

uc4w6c commented 9 months ago

@nakamura-to Thank you for resolving the issue.

nakamura-to commented 9 months ago

This fix has been included in the release of Doma 2.55.2. Please feel free to try out the revised version.

uc4w6c commented 9 months ago

@nakamura-to I created a PR #1049. Please check.

nakamura-to commented 9 months ago

Thanks!