Jsondb / jsondb-core

JsonDB a pure java database that stores its data as Json Files
http://www.jsondb.io
MIT License
212 stars 45 forks source link

Adds support for Id field in pojo superclass #27

Closed alexstaeding closed 5 years ago

alexstaeding commented 5 years ago

Currently, all annotated fields must be directly in the pojo, annotated fields from superclasses are not recognized. This PR adds support for the annotated fields to be in the POJO's superclass

For example:

public class JsonDbo {

    @Id
    private ObjectId id;

    // getter and setter
}
@Document(collection = "example", schemaVersion = "1.0")
public class Instance extends JsonDbo {

    private String name;
    // etc...
}
FarooqKhan commented 5 years ago

@alexstaeding Thank you for doing this, could you please also add a unit test for this addition when possible.