-
Notifications
You must be signed in to change notification settings - Fork 12
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
ByteArray class for primary keys with byte[] #17
Conversation
8cd72cd
to
0aa2cbf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall very good!
I request some minor improvements
- Add another (convenience) copy constructor to
ByteArray
, it will make the test so much nicer:
var copy = ByteArray.copy(ba); // copies ByteArray's bytes :-)
var copy2 = ba.copy(); // same as ByteArray.copy(ba), just alternative syntax
- Add tests for
ByteArray
-keyed entities toListingTest
andTableQueryBuilderTest
(to testTable.list()
andTable.query()
DSL explicitly)
Other than that, I think the PR is great!
} else if (value.isByteArray()) { | ||
checkArgument(fieldValueType == FieldValueType.BYTE_ARRAY, | ||
ByteArrayFieldExpected::new, | ||
p -> format("Specified a boolean value for non-boolean field \"%s\"", p)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: "boolean value", "non-boolean field" instead of "ByteArray value", "non-ByteArray field"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merging! 🎉
Byte arrays in primary keys support.
We can't do it with simple byte[], because records default comparator and equals uses compare adresses, not real data. Special class for this looks better, than magic over byte[]