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

Support for jMolecules' Association type #2315

Closed
odrotbohm opened this issue Feb 26, 2021 · 0 comments
Closed

Support for jMolecules' Association type #2315

odrotbohm opened this issue Feb 26, 2021 · 0 comments
Assignees
Labels
type: enhancement A general enhancement

Comments

@odrotbohm
Copy link
Member

It would be cool if Spring Data's object mapping infrastructure supported jMolecules Association type discovering it as logical association and automatically converting it into its identifier type and the underlying primitive value respectively:

class Aggregate {
  Association<OtherAggregate, OtherAggregateIdentifier> association;
}

class OtherAggregateIdentifier implements Identifier {
  UUID id;
}

The former needs PersistentProperty.isAssociation() to be made aware of the type. The latter can be implemented by adding the Converter implementations available in jMolecules jmolecules-spring artifact.

@odrotbohm odrotbohm added the type: enhancement A general enhancement label Feb 26, 2021
@odrotbohm odrotbohm added this to the 2.5 RC1 (2021.0.0) milestone Feb 26, 2021
@odrotbohm odrotbohm self-assigned this Feb 26, 2021
odrotbohm added a commit that referenced this issue Feb 26, 2021
We no recognize properties of type org.jmolecules.ddd.types.Association as associations in our PersistentProperty model.

Also, we now register JMolecules Converter implementations for Association and Identifier in CustomConversions so that they can persisted like their embedded primitive value out of the box.

Fixes #2315.
@mp911de mp911de closed this as completed in 6b0292c Mar 1, 2021
odrotbohm added a commit to spring-projects/spring-data-relational that referenced this issue Mar 11, 2021
…ers.

Previously, JdbcCustomConversion rejected any default converter that was not converting from and to java.util.Date. This probably stemmed from the fact that up until recently, Spring Data Commons' CustomConversions only registered date related default converters. As of spring-projects/spring-data-commons#2315 we also support jMolecules' Association and Identifier converters. We've relaxed the rejection to only explicitly reject all non Date/Time related converters if the conversion is from/to java.util.Date but allow everything else out of the box.
odrotbohm added a commit to spring-projects/spring-data-relational that referenced this issue Mar 11, 2021
…ers.

Previously, JdbcCustomConversion rejected any default converter that was not converting from and to java.util.Date. This probably stemmed from the fact that up until recently, Spring Data Commons' CustomConversions only registered date related default converters. As of spring-projects/spring-data-commons#2315 we also support jMolecules' Association and Identifier converters. We've relaxed the rejection to only explicitly reject all non Date/Time related converters if the conversion is from/to java.util.Date but allow everything else out of the box.
schauder pushed a commit to spring-projects/spring-data-relational that referenced this issue Mar 12, 2021
…ers.

Previously, JdbcCustomConversion rejected any default converter that was not converting from and to java.util.Date. This probably stemmed from the fact that up until recently, Spring Data Commons' CustomConversions only registered date related default converters. As of spring-projects/spring-data-commons#2315 we also support jMolecules' Association and Identifier converters. We've relaxed the rejection to only explicitly reject all non Date/Time related converters if the conversion is from/to java.util.Date but allow everything else out of the box.

Original pull request #937
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants