We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I'm creating a ddd store for Entity and ValueObject.
ValueObject will use it's hashcode as key in the store (and I'll manage collisions storing a list instead of a single value object)
My current approach use something like this:
trait ValueObject[R]: def schema: Schema[R] extension (valueObject: R) def isSameValueObjectAs(other: R): Boolean = schema.diff(valueObject, other).isIdentical def valueHashCode: Long = schema.toDynamic(valueObject).hashCode
This way I can do something like store.getValueObject[T: ValueObject](valueObject: T).filter(found => found.isSameValueObjectAs(valueObject).runHead
store.getValueObject[T: ValueObject](valueObject: T).filter(found => found.isSameValueObjectAs(valueObject).runHead
However in my tests I observe the hashCode generated using DynamicValue changes, making my code fail.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I'm creating a ddd store for Entity and ValueObject.
ValueObject will use it's hashcode as key in the store (and I'll manage collisions storing a list instead of a single value object)
My current approach use something like this:
This way I can do something like
store.getValueObject[T: ValueObject](valueObject: T).filter(found => found.isSameValueObjectAs(valueObject).runHead
However in my tests I observe the hashCode generated using DynamicValue changes, making my code fail.
The text was updated successfully, but these errors were encountered: