Support for storing large strings as multiple attribute/value pairs#5
Open
mikrado wants to merge 2 commits intoappoxy:masterfrom
Open
Support for storing large strings as multiple attribute/value pairs#5mikrado wants to merge 2 commits intoappoxy:masterfrom
mikrado wants to merge 2 commits intoappoxy:masterfrom
Conversation
Member
|
Does this replace the s3 storage? If so, is it configurable? s3 should still be the default to maintain backwards compatibility. Maybe as part of an annotation you can specify the strategy, ie s3 or split? |
Author
jayther
added a commit
to jayther/simplejpa
that referenced
this pull request
May 3, 2014
…lti-attributes, added OFFSET keyword support, and serialize objects to Base64. WARNING: Had to comment out foreign key and lobkey support due to its dependencies on beans and enhancers. Will re-add them when I have time to do it without beans and enhancers. WARNING: core/tests will have some commented/removed code, will add proper tests concerning the major changes. Removed most dependencies on get/set methods, beans, and enhancers. (There are still some enhancers and beans somewhere, but most of them shouldn't be used) Long strings get split to multiple attribute/value pairs (most code from appoxy#5 , adapted for more recent changes in SimpleJPA) Any serializable objects in members will be serialized into Base64 string (uses long strings split change). Added OFFSET keyword support, which does a count query and uses the next token to get wanted items (as suggested by AWS people). Added utility constructor in EntityManagerFactoryImp. SimpleJPA should ignore static fields now. Updated README.markdown (and fixed some stuff so it's actually readable). Signed-off-by: jayther <jayther@gmail.com>
jayther
added a commit
to jayther/simplejpa
that referenced
this pull request
May 3, 2014
…lti-attributes, added OFFSET keyword support, and serialize objects to Base64. WARNING: Had to comment out foreign key and lobkey support due to its dependencies on beans and enhancers. Will re-add them when I have time to do it without beans and enhancers. WARNING: core/tests will have some commented/removed code, will add proper tests concerning the major changes. Removed most dependencies on get/set methods, beans, and enhancers. (There are still some enhancers and beans somewhere, but most of them shouldn't be used) Long strings get split to multiple attribute/value pairs (most code from appoxy#5 , adapted for more recent changes in SimpleJPA) Any serializable objects in members will be serialized into Base64 string (uses long strings split change). Added OFFSET keyword support, which does a count query and uses the next token to get wanted items (as suggested by AWS people). Added utility constructor in EntityManagerFactoryImp. SimpleJPA should ignore static fields now. Updated README.markdown (and fixed some stuff so it's actually readable). Signed-off-by: jayther <jayther@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I am using SimpleJPA as persistence framework to access SimpleDB and found this piece of software very helpful.
I have recently added support for storing strings larger than 1024k by transparently splitting the string across multiple attribute value pairs in SimpleDB.
In my webapplication there is a form where users normally enter short strings but are allowed to enter longer texts as well. I can now transparently store these strings in a single property without the need to persist the property in S3.
I would like to contribute my changes to the SimpleJPA project. You can find details below. What do you think?
Details:
I have modified the Save-operation such that strings being larger than 1024k in UTF-8 are splitted into several chunks. Each chunk contains upto 1020k of data. Appended to the data is a counter which persists the order of chunks. Special care is taken not to split special characters which need more than one byte in UTF-8 encoding.
I have modified the ObjectBuilder accordingly: If there are multiple values for an attribute, the counter is retrieved and the values are concatenated in the correct order.
There is a new class for testing.