JPA might require quite a bit of support from the GWT compiler (I
doubt that would be high on their priority given the lack of browsers
that implement this feature at this moment).  However, native
Javascript does have reflection (I'm not sure if GWT exposes that
through Java's reflection - probably not).

    var props = new Array();

    for (var s in obj)
    {
        if (typeof(obj[s]) != "function") {
            props[props.length] = s;
        }
    }

I'm pretty sure the Java classes GWT compiles are regular JSON
objects.  Although of course you will run into the problem of trying
to map variable names to columns in the database since the variable
names in a class compiled by GWT will be mangled to try & minimize the
character count.

On Fri, Apr 17, 2009 at 9:37 AM, Arthur Kalmenson <[email protected]> wrote:
>
> Hi Sumit,
>
> Do you know if there are any plans to create a Gears based ORM? Maybe
> something that could use JPA/JDO annotations and GWT deferred binds
> (not sure if that's even possible)?
>
> --
> Arthur Kalmenson
>
>
>
> On Thu, Apr 16, 2009 at 12:42 PM, Sumit Chandel <[email protected]> 
> wrote:
>> Hi fvisticot,
>> Have you checked out the Gears binging for GWT in the GALGWT project? I
>> think the Database API exposed there should make it really easy to map your
>> POJOs to the client-side database and setup your CRUD operations around it
>> with a thin client-side data layer. All you would need to do is create
>> mappers that could take in your POJOs and now how to CRUD them into / out of
>> their mapped tables.
>> I also think that performing CRUD operations with the Gears DB using quick
>> get/set methods on the POJO will probably be slightly faster than
>> serializing / deserializing the POJO simply to store that representation
>> into the DB.
>> GALGWT Gears bindings:
>> http://code.google.com/docreader/#p=gwt-google-apis&s=gwt-google-apis&t=GearsGettingStarted
>>
>> Hope that helps,
>> -Sumit Chandel
>>
>> On Mon, Apr 13, 2009 at 1:54 PM, fvisticot <[email protected]> wrote:
>>>
>>> My client application is retrieving Pojo from the server.
>>> This Pojo implements Serializable and there is no pb to display this
>>> object on the browser.
>>> I would like to persist the Pojo in the Gears browser database. For
>>> doing that, i need to:
>>>
>>> 1. serialize my Pojo in Binary
>>> How to do that ?? (I wanted to use writeObject method from an
>>> outputStream BUT ByteArrayOutputStream is not available with GWT ???)
>>> 2. store the binary data in the Gears database.
>>> 3. when needed, read the data, unserialize with readObject...
>>>
>>> Is there a solution to serialize/unserialize a POJO ? How to retrieve
>>> the Binary data ??
>>>
>>
>>
>> >
>>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to