BraintagsGmbH/vertx-pojo-mapper

modify read / write for mongo

remi128 opened this issue · 2 comments

AbstractStoreObject iterates the fields of the mapper definition and writes reads / writes the values. In case of embedded / referenced annotation it processes the subfields. Currently the ObjectTypeHandler is defined to serialize objects by jackson.
modify this to:

  • check for fields / subfields marked as referenced. Handle those fields / subfields and store the resulting IDs into the savable instance as needed

  • serialize the complete instance by jackson

  • check GeoPoint and search

preferable the system of typehandlers is completely removed, referenced is resolved by IPropertyMapper only, a list of referenced fields can be requested by IMapper

Since this system then will allow the usage of all jackson annotations inside the mappers, we will have to find a solution in the following step to transfer those annotations for mysql

NOTE:
important to clear queries on fields, which are annotated for polymorphism like.

Example de.braintags.vertx.jomnigate.testdatastore.mapper.typehandler.EnumRecord:

@entity
public class EnumRecord extends BaseRecord {
@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, include = JsonTypeInfo.As.PROPERTY, property = "@Class")
public Enum enumEnum = WriteAction.INSERT;
}

will be serialized as:
{"id":null,"enumEnum":["de.braintags.vertx.jomnigate.dataaccess.write.WriteAction","INSERT"]}

merged into develop