Coder Social home page Coder Social logo

morphia-gwt's People

Contributors

ismetozalp avatar ozguraydinli avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

hegsie ks280first

morphia-gwt's Issues

CustomFieldSerializer(s) refeer to a non existing Morphia ObjectId property

I've a GWT 2.7.0 project with MongoDB Java Driver 3.0.2, Morphia 1.0.1 and Morphia-GWT 0.107.2.
I don't use Maven for build.
The class ObjectId_CustomFieldSerializer refeer to non existing properties _time, _machine and _inc of object org.bson.types.ObjectId.
Looking at the source of ObjectId.java from MongoDB Java Driver they seems not exixts anymore.
This cause ObjectId serialization errors.

gwt doesn't inherit properly?

I have made a jar from the sourcecode and put it into my gwt-project, along with morphia-0.107.jar (and the rest of the required libs).

Anyway, i get

[ERROR] [project] - Line 22: No source code is available for type org.bson.types.ObjectId; did you forget to inherit a required module?

what am i doing wrong?

org.mongodb.morphia.Key missing in 1.0.0-rc3

In 1.0.0-rc3, the serializer for org.mongodb.morphia.Key is missing. Key has been updated in Morphia 1.x so the serializer needs some changes for it to be compatible. I am testing a local build which seems to work with the following code:

  public static Key instantiate(SerializationStreamReader streamReader)
      throws SerializationException {
      Object id = (Serializable) streamReader.readObject();
      String collection = streamReader.readString();
      Class klass = (Class) streamReader.readObject();
    return new Key( klass, collection, id);
  }

  public static void serialize(SerializationStreamWriter streamWriter, Key instance)
      throws SerializationException {
    streamWriter.writeObject(instance.getId());
    streamWriter.writeString(instance.getCollection());
    streamWriter.writeObject(instance.getType());
  }

First release

Hi guys,
Does anyone know when the first release of this component happen? hopefully into maven or somewhere I can download the jar from?
Regards

By default ObjectId's (de)serializarion isn't compatible with RestyGWT and ReastEasy (Jackson backend)

Kind of question\howTo (move to wiki?)

ReastyGWT uses field for (de)serialization while Jackson uses geters\setters,
so here the unification- now we use filed on both sides:

@Provider
@Consumes({"application/*+json", "text/json"})
@Produces({"application/*+json", "text/json"})
public class AppResteasyJacksonProvider extends ResteasyJacksonProvider {
  public AppResteasyJacksonProvider() {
    super();
    setMapper(create());
  }

  // Use Jackson field based serialization
  private static ObjectMapper create() {
    ObjectMapper mapper = new ObjectMapper();
    VisibilityChecker<?> visibilityChecker = mapper.getVisibilityChecker()//
        .withFieldVisibility(JsonAutoDetect.Visibility.ANY)//
        .withGetterVisibility(JsonAutoDetect.Visibility.NONE)//
        .withIsGetterVisibility(JsonAutoDetect.Visibility.NONE)//
        .withSetterVisibility(JsonAutoDetect.Visibility.NONE);
    mapper.setVisibilityChecker(visibilityChecker);
    return mapper;
  }
}

another way is to use Jackson MixIns

Maybe it is possible to solve the problem on morphia-gwt side?
Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.