Re: [protobuf] Architectural question - Java - proto - C#

2010-09-21 Thread Kenton Varda
It's true that you wouldn't be able to take advantage of the JPA annotations. However, I'd imagine JPA provides a lower-level API that lets you use it with objects that aren't annotated. On Wed, Sep 15, 2010 at 8:41 AM, Roberto Caldas roberto.cal...@gmail.comwrote: If you're using the

Re: [protobuf] Architectural question - Java - proto - C#

2010-09-15 Thread David Yu
For existing java beans, http://code.google.com/p/protostuff might be able to help. On Tue, Sep 14, 2010 at 8:27 PM, Roberto Caldas roberto.cal...@gmail.comwrote: Yes, I tried to use the reflection API, but this doesn't seem right to me because I have to mantain 3 classes for the same entity.

Re: [protobuf] Architectural question - Java - proto - C#

2010-09-15 Thread Roberto Caldas
If you're using the reflection API correctly, that shouldn't be necessary. There is something very wrong here, because I just can't see this :( I must have a simple POJO Person.java with JPA annotations in it, I cannot persist a byte array of my message, otherwise I wouldn't be able to make SQL

Re: [protobuf] Architectural question - Java - proto - C#

2010-09-14 Thread Kenton Varda
I'm not all that familiar with JPA, but my guess is that applying JPA to a protocol buffer type is going to be much less efficient than using protobuf's native encoding. So you probably want to be serializing your protobufs with .toByteArray() and then persisting that. Failing that, you might

Re: [protobuf] Architectural question - Java - proto - C#

2010-09-14 Thread Roberto Caldas
Yes, I tried to use the reflection API, but this doesn't seem right to me because I have to mantain 3 classes for the same entity. When I add a new attribute I'll have to update 3 files! I know I really cannot use JPA with the java code generated by protoc, but using the reflection API the best

[protobuf] Architectural question - Java - proto - C#

2010-09-13 Thread roberto_sc
Hi I have a basic question about how to organize my project. I have a client running C# code, a server running Java code and I intend to use protocol buffers to exchange data. I thought I could use the .proto file to describe the classes of my datamodel and generate .java and .cs and then use