google-code-export / objectify-appengine

Automatically exported from code.google.com/p/objectify-appengine
MIT License
1 stars 0 forks source link

Please add support for protobufs in objectify entities. #205

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use objectify v5.
2. Add a protobuf to an entity.
3. Try to load an instance of the entity.

What is the expected output? What do you see instead?

I would like it to work. (I'd really also like to be able to save an entity 
with a protobuf in it.) I don't mind having to add annotations or requiring 
that it always be the same type of protobuf.

Uncaught exception from servlet
com.googlecode.objectify.LoadException: Error loading [stuff]: 
[ProtobuufClassName] must be static and must have a no-arg constructor
    at com.googlecode.objectify.impl.EntityMetadata.load(EntityMetadata.java:78)
    at com.googlecode.objectify.impl.LoadEngine.load(LoadEngine.java:188)
    at com.googlecode.objectify.impl.LoadEngine$1.nowUncached(LoadEngine.java:146)
    at com.googlecode.objectify.impl.LoadEngine$1.nowUncached(LoadEngine.java:132)
    at com.googlecode.objectify.util.ResultCache.now(ResultCache.java:30)
    at com.googlecode.objectify.impl.Round$1.nowUncached(Round.java:71)
    at com.googlecode.objectify.util.ResultCache.now(ResultCache.java:30)
    at com.googlecode.objectify.LoadResult.now(LoadResult.java:25)

What version of the product are you using? On what operating system?

Objectify v5 on Linux.

Please provide any additional information below.

As a workaround for now I'll either been creating a class just to store the 
contents of the protobuf or storing it as a byte array and 
serializing/deserializing manually.

Original issue reported on code.google.com by ivan.the...@gmail.com on 3 Jun 2014 at 11:18

GoogleCodeExporter commented 9 years ago
Can you provide an example of how you would want this to work? What would the 
annotations look like?

The best way of getting features like this implemented is to submit a PR with a 
(failing) test case. If it looks good, we'll figure out how to make it pass.

Original comment by lhori...@gmail.com on 4 Jun 2014 at 3:40